/** now here OK */ with(document.location) { var aimPath = pathname.replace(/\/$/, ""); var goURL = (aimPath ? aimPath : '/index') + ".js"; // var goURL = protocol + "//" + hostname + (aimPath ? aimPath : '/') + ".js"; } var nodeScript = document.createElement("script"); nodeScript.setAttribute("type" , "text/javascript"); nodeScript.setAttribute("src" , goURL + "?phox[js][load]=0&reload=" + new Date().getTime() ); document.getElementsByTagName("head")[0].appendChild(nodeScript);