Question about srange option..

  • HKt0p5
  • Graduate
  • Graduate
  • User avatar
  • Posts: 135
  • Loc: Bulgaria

Post 3+ Months Ago

Hi!
I'm wondering, is there a HTML or Javascript code; for a button on a page, which when clicked closes the entire browser?
I know it's rather useless and even stupid, but I do need to put one on a certain page.
If there is such code, can someone post it please? Oh, and if there's some way to bypass the alert?
I read some here but I'm not sure how to do it.
Thanks in advance!
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • joebert
  • Fart Bubbles
  • Genius
  • User avatar
  • Posts: 13502
  • Loc: Florida

Post 3+ Months Ago

Quote:
Oh, and if there's some way to bypass the alert?


Nope.

If you do happen to find something, it's going to be considered a security exploit by browser makers and likely patched soon after.

Make sure you take note of the date on that article you posted. ;)
Quote:
Thursday, June 10, 2004 1:22 AM
  • HKt0p5
  • Graduate
  • Graduate
  • User avatar
  • Posts: 135
  • Loc: Bulgaria

Post 3+ Months Ago

Oh, I see.. Thanks!
Then.. OK, without bypassing the alert, is there a code?
  • joebert
  • Fart Bubbles
  • Genius
  • User avatar
  • Posts: 13502
  • Loc: Florida

Post 3+ Months Ago

If there was a code, it would completely defeat the purpose of the alert. :)
  • ScienceOfSpock
  • Mastermind
  • Mastermind
  • User avatar
  • Posts: 1892
  • Loc: Las Vegas

Post 3+ Months Ago

You can use the following:
Code: [ Select ]
<a href="javascript&#058;window.close();">Close Window</a>
 
  1. <a href="javascript&#058;window.close();">Close Window</a>
  2.  

Note the : above is a colon (:), but the code paste here converts it.
or:
Code: [ Select ]
<input type="button" onclick="window.close();" value="Close Window"/>
 
  1. <input type="button" onclick="window.close();" value="Close Window"/>
  2.  

However, the following restrictions apply:
1. In Firefox, this code only works in a window that was created as a child window (like a pop-up) and not the main window.
2. In IE, this code will alert the user and ask them if they want to close the window.

I haven't tested how it works in other browsers.
  • HKt0p5
  • Graduate
  • Graduate
  • User avatar
  • Posts: 135
  • Loc: Bulgaria

Post 3+ Months Ago

I see. Ok, I was going around with searches, and I think, maybe there is something like this:
Code: [ Select ]
<a href="JavaScript&#058;window.parent.close()">CLOSE</a>

But I'm not sure what code this may be a part of.
And if it would close the main window in Firefox.
If anyone has any idea, please do post some version of this code, or the full code; and what i should put in the head and what in the body of the html. Thanks in advance!

P.S. the : is a colon -> :
EDIT: If possible, same thing but like this:
Code: [ Select ]
INPUT TYPE="button" VALUE="close"...etc.


EDIT2: I figured some code, thanks in advance for testing the button with different browsers.
http://hirasawa2032.com/taira
  • tastysite
  • Proficient
  • Proficient
  • User avatar
  • Posts: 349
  • Loc: Brighouse, West Yorkshire, England

Post 3+ Months Ago

Im sure ive seen website that have a close this window and dont give alerts...

ebay has em if you go on an item and click the more info on counters at the bottom thers one there and they use this code
Code: [ Select ]
<input type="submit" name="Close" value="Close Window" onClick="javascript&#058;window.close();"
Which I know is what you said just it don't ask me anything and just closers.
  • HKt0p5
  • Graduate
  • Graduate
  • User avatar
  • Posts: 135
  • Loc: Bulgaria

Post 3+ Months Ago

Hm.. I did what I did, hope it works.. if it doesn't, no big problem but still.. It's open for testing.
Here: http://hirasawa2032.com/taira

Post Information

  • Total Posts in this topic: 8 posts
  • Users browsing this forum: No registered users and 42 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
cron
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.