window.onload=function(){
try{
if(test&&typeof(test)=="function"){
test();
}else{
alert("Function that does not exist");
}
}catch(e){
}
}
function test(){
alert("Function execution...");
}
If not If it exists, an exception will be thrown, so try...catch must be added.