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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to supress browser's warning message using Javascript?

Status
Not open for further replies.

royboy75

Programmer
Feb 13, 2007
114
GB
Hello,

I have created a simple javascript function that reloads the page when calling it.
When users click on a button that activates this function they receive a warning message that the page cannot be reloaded without resending the information to the server.
Is there any to supress this warning message using Javascript code?

 
Pretty sure that can't be done. Like 99.9% sure.

[small]"Mom........MEATLOAF!!!! F***!!!!"[/small]
<.
 
Can I supress it using browser settings?
 
That wouldn't really help you because you'd have to convince all your users to enable/disable that setting. The message is to let you know that the page you've just loaded has received post submitted information. If you reload the page, it's going to essentially "resubmit" that information. So.... say your page receives a submission and inserts some rows into a table when it's loaded - when you refresh that table it acts as a new submission and the rows are inserted into the table again. This warning is to let you know that it's happening, as many people may not want that to happen.

It's there for a reason, it's probably not a good idea to attempt stifling it even if it was possible - which it's not.

-kaht

Looking for a puppy? [small](Silky Terriers are hypoallergenic dogs that make great indoor pets due to their lack of shedding and small size)[/small]
 
IF that is possible,(I'm not sure it is), you would have to get access to the client's computer. With Javascript that is only done with an ActiveX object. If you have to use an ActiveX object, a prompt will come up on the client's computer asking to allow permission to run the object. Either way, you're going to have some type of message pop up. The ActiveX warning message is a lot more intrusive feeling than the reload from form message.

[small]"Mom........MEATLOAF!!!! F***!!!!"[/small]
<.
 
Thanks a lot guys I think I'll just keep living with this message :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top