My code is
function getID( swfID ){
if(navigator.appName.indexOf("Microsoft") != -1){
me = window[swfID];
}else{
me = document[swfID];
}
}
function js_to_as( str ){
me.onChange(str);
}
However, sometimes my onChange does not load. Firebug errors with
me.onChange is not a function
I want to degrade gracefully because this is not the most important feature in my program. typeof gives the same error.
Any suggestions on how to make sure that it exists and then only execute onChange?
(None of the methods below except try catch one work)
On this page of the site you can watch the video online How to check if function exists in JavaScript? with a duration of hours minute second in good quality, which was uploaded by the user Code Samples 03 April 2024, share the link with friends and acquaintances, this video has already been watched 17 times on youtube and it was liked by 0 viewers. Enjoy your viewing!