document.write loads js

The principle of synchronous loading and asynchronous loading of javascript files is that
the script in html references the usage of js files again
if(location.pathname=="/System/index.html"){
document.write("<script src='test. js'><"+'/'+"script>");
// document.write("<script type='text/javascript' src='a.js'><\/script>");// js escape character
console.log("Jump page/Sytem/index.html");
}else{
console.log(location.pathname)
console.log("Other yemain");
} The
page achieves the effect, as shown in the following figure Show (asynchronously loaded js successfully, but 404 means not found)

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324779082&siteId=291194637