pad: Use a relative URL to simplify

Also avoid creating an unnecessary variable.
This commit is contained in:
Richard Hansen 2020-11-17 00:40:21 -05:00 committed by John McLear
parent 41d02db023
commit 93c335b3b8

View file

@ -513,7 +513,7 @@ function setupGlobalExceptionHandler() {
} }
// send javascript errors to the server // send javascript errors to the server
var errObj = { $.post('../jserror', {
errorInfo: JSON.stringify({ errorInfo: JSON.stringify({
errorId, errorId,
msg, msg,
@ -522,11 +522,7 @@ function setupGlobalExceptionHandler() {
linenumber, linenumber,
userAgent: navigator.userAgent, userAgent: navigator.userAgent,
}), }),
}; });
var loc = document.location;
var url = loc.protocol + "//" + loc.hostname + ":" + loc.port + "/" + loc.pathname.substr(1, loc.pathname.indexOf("/p/")) + "jserror";
$.post(url, errObj);
return false; return false;
}; };