954,598 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

exit button

Hello, Thank you for your time.

I know it is possible to create an exit button using javascript but this only work in ie browsers and not what i want(i found a fix for it but isnt very good), can somebody please show me a better way of closing all types of browsers(Chrome, Mozilla, Internet Explorer).

Thanks

brynFlew
Junior Poster in Training
59 posts since Jan 2011
Reputation Points: 27
Solved Threads: 1
 

This works in IE, FF, and Chrome...

<input type="button" value="Close Window" onclick="window.close()">
pixelsoul
Junior Poster
124 posts since Feb 2011
Reputation Points: 54
Solved Threads: 23
 

This works in IE, FF, and Chrome...

<input type="button" value="Close Window" onclick="window.close()">

So this should work.....

<input type="button" style="float:left;width:100px;" value="Exit" onclick="window.close();"/></p>


but does not work for me. How did you make it work and close a chrome browser because no matter how many times i click that button it will not close chrome or Mozilla, but in ie it will close with one click.

i tried this aswell window.opener = self;

brynFlew
Junior Poster in Training
59 posts since Jan 2011
Reputation Points: 27
Solved Threads: 1
 

Meh, well it only works apparently when that window was opened by another window. It won't work if the window was opened any other way I guess.

pixelsoul
Junior Poster
124 posts since Feb 2011
Reputation Points: 54
Solved Threads: 23
 

so its not possible to close chrome and firefox with the click of a button? i dont want to use the top right exit button i want to hide the tool bar for an app and have a exit button that users can click on a scanner and close the page without seeing the toolbar for web restricted access on the portable device.

brynFlew
Junior Poster in Training
59 posts since Jan 2011
Reputation Points: 27
Solved Threads: 1
 

It doesn't seem to be possible, and frankly it shouldn't be. It doesn't really make sense to take away the users default way of closing the browser.

Regards
Arkinder

Arkinder
Posting Pro in Training
454 posts since Nov 2010
Reputation Points: 113
Solved Threads: 59
 

can somebody try and explain to me why this isn't possible or why its not allowed. whats the difference if i create a button that basically does the same thing as the default close button but i want it somewhere else, this seems restricting for what reasons.

brynFlew
Junior Poster in Training
59 posts since Jan 2011
Reputation Points: 27
Solved Threads: 1
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You