Is it possible to check whether a browser-provided function has been replaced by user code?
function alert(str){
document.write(str);
}
alert('hello world');
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.
It is impossible to know if browser methods are overwirtten or not. e.g.
About all you can say is that if you don’t get the default response, the method was probably modified since the toString method of host methods is generally read only. But if you get the default, you don’t know if it was modified or not.