Created
August 13, 2013 10:10
-
-
Save codescribler/6219793 to your computer and use it in GitHub Desktop.
A javascript function to hook up the on error event to post the error to my server side logger.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
window.onerror = function (errorText, url, lineNumber) { | |
var report = { | |
errorText: errorText, | |
url: url, | |
lineNumber: lineNumber | |
}; | |
$.ajax({ | |
type: "POST", | |
url: "/error/record", | |
dataType: 'json', | |
data: report, | |
cache: false | |
}); | |
}; | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment