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.
Statement:The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn