: You can't do it with HTML full stop, and if you don't want people like me annoyed with you for using VBscript, you can't do it with that either. It can be done with Javascript in a much more browser-compatible way, and I can't think of any reason you'd need to use VBscript specifically, at least not for something like this.
:
: <form>
: <input type="button" onclick="window.close();">
: </form>
:
Agree. JavaScript is certainly the right tool for the job, and should be chosen over VBScript whenever possible. JavaScript is also a little less ugly than VBScript.
: There'll be a confirmation box when they click, as a security measure (or something like that).
:
I think this depends on who created the window. If you window.open'd it yourself, then calling window.close won't cause any upset (so far as I'm aware). It's when you close windows the user opened ("main" browser windows) that the messages appear.
That's the best model for the behaviour IE exhibits that I can come up with, anyway. Of course, we are talking IE here so internally it's probably more like...
if (rand() > 0.5)
showCloseWindowWarning;
Jonathan
###
for(74,117,115,116){$::a.=chr};(($_.='qwertyui')&&
(tr/yuiqwert/her anot/))for($::b);for($::c){$_.=$^X;
/(p.{2}l)/;$_=$1}$::b=~/(..)$/;print("$::a$::b $::c hack$1.");