var script = $('<script src="....."></script>');
$('body').append(script);
var head = document.getElementsByTagName( 'head' )[0]; var script = document.createElement( 'script' ); script.type = 'text/javascript' ; script.src = 'a.js' ; head.appendChild(script); |
var
s = document.createElement(
"SCRIPT"
);
s.type =
"text/javascript"
;
s.innerHTML =
"your code"
;
document.getElemnetsByTagName(
"HEAD"
)[0].appendChild(s);
window.onload =
function
()
{
var
scpt = document.createElement(
"SCRIPT"
);
scpt.type =
"text/javascript"
;
scpt.src =
"en.js"
;
document.getElemnetsByTagName(
"HEAD"
)[0].appendChild(scpt);
setTimeout(
function
(){
alert(syslang[
"en"
].a);
},1).
}
var script = document.createElement("script") script.src = "//url.com/jquery.js"var s = document.getElementsByTagName("script")[0]s.parentNode.insertBefore(script, s)
var script=$('<script>alert("I am a script element")<\/script>');$('body').append(script);
注意那个转义符号,这个是关键