Ensure URL is properly formed

This commit is contained in:
Themba Dube 2019-06-16 13:06:46 -04:00
parent bb26bd9676
commit a16c4e177d

View File

@ -111,14 +111,17 @@
/* Assemble the URL */
var newPathname = "";
var pathArray = window.location.pathname.split('/');
for (i = 0; i < pathArray.length - 1; i++) {
if(pathArray[i].length === 0)
continue;
newPathname += "/";
newPathname += pathArray[i];
}
newPathname += "/lvgl.html?env=dev";
iframe.setAttribute("data-cscript", LZString.compressToEncodedURIComponent(editor.getValue()));
iframe.src = window.location.protocol + window.location.host + "/" + newPathname;
iframe.src = window.location.protocol + "//" + window.location.host + newPathname;
console.log(iframe.src);
iframe.onload = function() {
$this.removeProp("disabled");