filmov
tv
How to check if function exists in JavaScript?

Показать описание
My code is
function getID( swfID ){
me = window[swfID];
}else{
me = document[swfID];
}
}
function js_to_as( str ){
}
However, sometimes my onChange does not load. Firebug errors with
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)
function getID( swfID ){
me = window[swfID];
}else{
me = document[swfID];
}
}
function js_to_as( str ){
}
However, sometimes my onChange does not load. Firebug errors with
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)