From 93c335b3b8fc6bdf332f194412a69ee3a40ce50f Mon Sep 17 00:00:00 2001 From: Richard Hansen Date: Tue, 17 Nov 2020 00:40:21 -0500 Subject: [PATCH] pad: Use a relative URL to simplify Also avoid creating an unnecessary variable. --- src/static/js/pad_utils.js | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/static/js/pad_utils.js b/src/static/js/pad_utils.js index a2c1472d3..130c7dc8a 100644 --- a/src/static/js/pad_utils.js +++ b/src/static/js/pad_utils.js @@ -512,8 +512,8 @@ function setupGlobalExceptionHandler() { }); } - //send javascript errors to the server - var errObj = { + // send javascript errors to the server + $.post('../jserror', { errorInfo: JSON.stringify({ errorId, msg, @@ -522,11 +522,7 @@ function setupGlobalExceptionHandler() { linenumber, 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; };