Make a browser close after n seconds

Make a browser close after n seconds can someone give me the script for it and
how to make a new window open when a user double click but when a user clicks
once it doesent do anything please the code for both of them.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

you cannot always close the whole browser, but you can close a browser window in n seconds:
<SCRIPT LANGUAGE="JavaScript"><!--
  setTimeout("self.close()", n)
//--> </SCRIPT>

A doubleclick is only recognized with netscape Communicator 4; however here's a trick that does something when you click twice on a button:

<INPUT TYPE="BUTTON" VALUE="doubleclick me" onClick="test()">

and the function test looks like this:

var count = 0
function test(){
  if (count==2){
   var MyWin = new window()"newwindow.html")
  } else setTimeout("count--", 500)

so the user has 500 milliseconds to click twice on the button, otherwise the counter is set back.

If you have questions about this, please leave me a comment here, I'll try to answer asap. :-)

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Marc1Author Commented:
Thanks alot
with the double click is there a way to instead of a button i couls put a link?
if you let the link point to the JavaScript function (HREF="JavaScript:functionname()"), it should be possible...
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.