Home > jQuery > Javascript – Global Error Handler

Javascript – Global Error Handler

window.onerror = function(error, url, line) {
    var errorDetails = "Error Description = " + error;
    errorDetails += "\nUrl = " + url;
    errorDetails += "\nLine Number = " + line;

    alert(errorDetails);
};
Advertisements
Categories: jQuery Tags: ,
  1. Daniel Chavez Moran
    April 4, 2013 at 6:13 AM

    Hello, I enjoy reading all of your article. I wanted to
    write a little comment to support you.

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: