Add onerror function to window - Node.js HTML

Node.js examples for HTML:Window

Description

Add onerror function to window

Demo Code

window.onerror = function(errorMsg, url, lineNumber) {
  var msg = "Error happened on <"+url+
    "\n> on line "+lineNumber+":\n"+
    errorMsg;/*from ww w  .j a v a  2  s .  co  m*/
  alert(msg);
}

Related Tutorials