Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Close Button

Omega99Omega99 Posts: 19Member
I need to put a button on my page that closes the window. I need to do this either by using html or vb script. Does anyone know how to do this?

any help or sample code would be greatly appreciated,

Omega99

Comments

  • WeirdofreakWeirdofreak Posts: 439Member
    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.





    There'll be a confirmation box when they click, as a security measure (or something like that).
  • JonathanJonathan Posts: 2,914Member
    : 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.
    :
    :
    :
    :
    :
    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...

    [code]if (rand() > 0.5)
    showCloseWindowWarning;[/code]

    ;-)

    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.");

Sign In or Register to comment.