If I have something like
alert = 0;
in another script.
This is in another script is and my code cannot load before that script.
How can I call the original alert method in my script?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Before overriding the original
alert, save it.Demo: http://jsfiddle.net/jfriend00/tnNE7/
If you can’t save the original value, the only other way I know of to get access to it is in an iframe. Here’s an example:
Working example: http://jsfiddle.net/jfriend00/waMEV/
I haven’t tried this in all browsers, but it works in Chrome, IE and Firefox and I think it should work in other browsers.