重新window.onerror方法就行了

window.onerror = handleError
function handleError(msg,url,l)
{
  var txt="There was an error on this page.\n\n"
    txt+="Error: " + msg + "\n"
    txt+="URL: " + url + "\n"
    txt+="Line: " + l + "\n\n"
    txt+="Click OK to continue.\n\n"
    alert(txt)
    return true
} //如果返回值为 false,则在控制台 (JavaScript console) 中显示错误消息。反之则不会

  

  

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-01
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-08-22
  • 2021-08-23
  • 2021-08-17
  • 2021-09-26
  • 2021-06-20
  • 2021-06-23
相关资源
相似解决方案