P
Paul
I am looking for a java script to close a web form that I can attatch to a
button click event. I am using vs2005, c#.
Thanks
button click event. I am using vs2005, c#.
Thanks
Mark Rae said:[top-posting corrected]
The script "window.close()" close the window in the browser. Is this
that you need?
That will generate a message asking the user to confirm that they want to
close the window, and you have omitted the final semi-colon.
The correct JavaScript is:
"window.opener=null;window.close();"
Mark said:That will generate a message asking the user to confirm that they want
to close the window, and you have omitted the final semi-colon.
The correct JavaScript is:
"window.opener=null;window.close();"
bruce said:setting opener to null was a trick that works due a (minor) security bug
with ie 6.0 (opener should be read only). no properly coded browser will
allow javascript to close a main (non popup) window, only windows that
were opened with javascript (and thus have an opener defined) will
respond to window.close().
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.