1(function( $ ) { 2 'use strict'; 3 4 // Log javascript errors in the front end via XHR https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest 5 // Code source: https://plugins.svn.wordpress.org/javascript-error-reporting-client/tags/1.0.3/public/js/jerc.js 6 7 window.onerror = function(msg, url, lineNo, columnNo, error) { 8 9 var data = { 10 nonce: dlmVars.jsErrorLogging.nonce, 11 message: msg, 12 script: url, 13 lineNo: lineNo, 14 columnNo: columnNo, 15 pageUrl: window.location.pathname + window.location.search, 16 type: 'front end' 17 } 18 19 var xhr = new XMLHttpRequest(); 20 xhr.open("POST", dlmVars.jsErrorLogging.url + "?action=" + dlmVars.jsErrorLogging.action ); 21 xhr.setRequestHeader('Content-type', 'application/json'); 22 xhr.send(JSON.stringify(data)); 23 return false; 24 25 } 26 27})( jQuery );
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.