Created
September 3, 2012 08:33
-
-
Save trullock/3607896 to your computer and use it in GitHub Desktop.
This file contains 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
(function(){ | |
var student, country, region; | |
bus.subscribe('student state changed', function(s) { | |
student = s; | |
}); | |
bus.subscribe('country changed', function(c) { | |
country = c; | |
}); | |
bus.subscribe('region changed', function(r) { | |
region = r; | |
}); | |
try { | |
window.onerror = function (e, url, line) { | |
var browser = {}; | |
for (var propertyName in window.navigator) | |
browser[propertyName] = window.navigator[propertyName] | |
var data = { | |
browser: browser | |
, country: country | |
, region: region | |
, student: student | |
, error: { | |
ex: e, | |
url: url, | |
line: line | |
} | |
}; | |
$.ajax({ | |
type: 'POST', | |
url: '/ajax/error', | |
data: data | |
}); | |
}; | |
} | |
catch (e) { } | |
}()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment