可以创建一个js文件,如hello.js
content: alert('hello');
在html页面中可以添加一个函数:
function test(){
var s=document.createElement("script");
s.src="hello.js";//路径
document.documentElement.appendChild(s);
}
可以在页面中,调用此函数,则会再去调用js。
content: alert('hello');
在html页面中可以添加一个函数:
function test(){
var s=document.createElement("script");
s.src="hello.js";//路径
document.documentElement.appendChild(s);
}
可以在页面中,调用此函数,则会再去调用js。