diff options
author | Jakob Stendahl <jakob.stendahl@outlook.com> | 2017-10-25 17:09:06 +0200 |
---|---|---|
committer | Jakob Stendahl <jakob.stendahl@outlook.com> | 2017-10-25 17:09:06 +0200 |
commit | 767dfd736d519235b2485f89c9932755bb16aa6c (patch) | |
tree | f64718dec5c97c32bd7f3d24f96b1ebdae639c1a | |
parent | 9cc5356fb7a347aac223997c8ece296fe2bd4f96 (diff) | |
download | Luxcena-cs-767dfd736d519235b2485f89c9932755bb16aa6c.tar.gz Luxcena-cs-767dfd736d519235b2485f89c9932755bb16aa6c.zip |
Removed escaping char from string
-rw-r--r-- | script.h | 26 |
1 files changed, 13 insertions, 13 deletions
@@ -1,20 +1,20 @@ -const char script[] PROGMEM = R"=====( +const char main_script[] PROGMEM = R"=====( function fixNoNetwork() { - if (getParameterByName(\"l\") != null) { - document.getElementById(\"homePageAddr\").href = \"/?l=1\"; - document.getElementById(\"settingsPageAddr\").href = \"/settings?l=1\"; + if (getParameterByName("l") != null) { + document.getElementById("homePageAddr").href = "/?l=1"; + document.getElementById("settingsPageAddr").href = "/settings?l=1"; return; } try { var xhttp = new XMLHttpRequest(); xhttp.onerror = function onError(e) { - //alert(\"Error \" + e.target.status + \" occurred while receiving the document.\"); - var hrefAddr = window.location.href + \"?l=1\"; + //alert("Error " + e.target.status + " occurred while receiving the document."); + var hrefAddr = window.location.href + "?l=1"; window.location.replace(hrefAddr); }; - xhttp.open(\"GET\", \"https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.2/css/bootstrap.min.css\", true); - xhttp.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded\"); + xhttp.open("GET", "https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.2/css/bootstrap.min.css", true); + xhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); xhttp.send(); } catch (e) { console.log(e); @@ -30,18 +30,18 @@ function ajax_request(adress, callback_function) { callback_function(this.responseText); } }; - xhttp.open(\"POST\", adress, true); - xhttp.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded\"); + xhttp.open("POST", adress, true); + xhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); xhttp.send(); } function getParameterByName(name, url) { if (!url) url = window.location.href; - name = name.replace(/[\[\]]/g, \"\\$&\"); - var regex = new RegExp(\"[?&]\" + name + \"(=([^&#]*)|&|#|$)\"), + name = name.replace(/[\[\]]/g, "\\$&"); + var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"), results = regex.exec(url); if (!results) return null; if (!results[2]) return ''; - return decodeURIComponent(results[2].replace(/\+/g, \" \")); + return decodeURIComponent(results[2].replace(/\+/g, " ")); } )====="; |