Believe it or not, you may come up against a situation where you do not whether a Javascript function exists in your page or not…. here is my scenario.
I am using usercontrols that are added to the page IF certain settings are set in the webconfig (something you might do if someone has one of your apps installed or has purchased a certain portions of your app) … so its possible this usercontrol has not been added to my page.
SO I need to know if I have a certain javascript function so that I can call it…. however if I call it or test for it WRONG I will get a Javascript error.
Here is the simple way to test this situation:
if(window.myJavascriptFunction) {
//do whatever I want to do now… like just CALL IT!
myJavascriptFunction();
}
hope this helps!
t
