并尝试使用“try ~ catch”进行捕获,但它不起作用。
function a(){
try{
var img1 = "==""; <#-- it occurs error -->
}catch (e) {
console.log("image error:" + e.message);
}
}
Run Code Online (Sandbox Code Playgroud)javascript error-handling try-catch uncaughtexceptionhandler