Fixing bug with otherly-named htmls
This commit is contained in:
4
index.js
4
index.js
@@ -71,10 +71,8 @@ Object.defineProperty(window, 'routes', {
|
|||||||
});
|
});
|
||||||
function locationChange() {
|
function locationChange() {
|
||||||
console.log("location change")
|
console.log("location change")
|
||||||
let URL = window.location.pathname.split("/").filter(d => (d !== 'Web') && (d !== 'index.html')).join("/")
|
let URL = window.location.pathname.split("/").filter(d => (d !== 'Web') && (!d.includes('.html'))).join("/")
|
||||||
if(URL === "") URL = "/"
|
if(URL === "") URL = "/"
|
||||||
console.log(URL)
|
|
||||||
console.log(document.body.children[0])
|
|
||||||
let wrapper = document.querySelector("#wrapper");
|
let wrapper = document.querySelector("#wrapper");
|
||||||
if(wrapper) {
|
if(wrapper) {
|
||||||
wrapper.replaceWith(new window.routes[URL]())
|
wrapper.replaceWith(new window.routes[URL]())
|
||||||
|
|||||||
Reference in New Issue
Block a user