Friday, February 25, 2011

JavaScript check whether a function is defined

if (typeof myFun == "undefined") {
alert('undefined');
}
else {
alert('defined');
}
function myFun()
{ }

No comments: