= new XMLHttpRequest(); var scripturl = "http://yourdomain.example.com/report"; var log = linenumber + message + url; xhr.open("POST", scripturl); xhr.setRequestHeader("Content-Type", "text/plain; charset=UTF-8"); xhr.send(log); } } function reportEx(ex) { // Extract Info from exception var info = extract(ex); report(info.message, info.url, info.lineno); } Some Helpers