Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

While Closing the window, have to override the windows alert...

Status
Not open for further replies.

nithink

Programmer
Nov 7, 2002
92
0
0
US
Hi,
While closing the browser, I'm getting the Windows generated alert. I want my alert message to be displayed overriding the windows alert. Can I please know how to override the WINDOWS ALERT ? thx... ur help appreciated..
 
If the window is opened through a script, you will not get the alert when you close the window. To put your own custom alert in, you can call a function in the onClick of your hyperlink that closes the window and put in:

if (confirm('Are you sure you want to close this window')){
window.close
}

 
this question is repeatedly asked and answered along with some strong opinions to why to and why not to do it. Try doing a search of Tek=Tips to find the solution. ---------------------------------------
{ str = "sleep is good for you. sleep gives you the energy you need to function";
ptr = /sleep/gi;Nstr = str.replace(ptr,"coffee");alert(Nstr); }

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top