Changes

Jump to navigation Jump to search
Better style
Line 1: Line 1:  
if (location.href.startsWith("http://")) {
 
if (location.href.startsWith("http://")) {
 
     var nav = document.querySelector("#p-navigation ul");
 
     var nav = document.querySelector("#p-navigation ul");
     var a = document.createElement("a");
+
     var li = document.createElement("li");
     a.href = "https://" + location.href.substring("http://".length);
+
     var href = "https://" + location.href.substring("http://".length);
     a.innerText = "Upgrade to HTTPS";
+
     li.innerHTML = '<a href="' + href + '">Upgrade to HTTPS</a>";
     nav.insertBefore(a, nav.children[1]);
+
     nav.insertBefore(ali, nav.children[1]);
 
}
 
}

Navigation menu