标签:firefox ready tac util UNC dde cti 兼容 list
方法一:Script Dom Element
1
2
3
4
5
6
7
8
|
(function(){ var scriptEle = document.createElement("script"); scriptEle.type = "text/javasctipt"; scriptEle.async = true; scriptEle.src = "http://cdn.bootcss.com/jquery/3.0.0-beta1/jquery.min.js"; var x = document.getElementsByTagName("head")[0]; x.insertBefore(scriptEle, x.firstChild); })(); |
1
2
3
4
5
6
7
8
|
(function(){; var ga = document.createElement(‘script‘); ga.type = ‘text/javascript‘; ga.async = true; ga.src = (‘https:‘ == document.location.protocol ? ‘https://ssl‘ : ‘http://www‘) + ‘.google-analytics.com/ga.js‘; var s = document.getElementsByTagName(‘script‘)[0]; s.parentNode.insertBefore(ga, s); })(); |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
(function(){ if(window.attachEvent){ window.attachEvent("load", asyncLoad); }else{ window.addEventListener("load", asyncLoad); } var asyncLoad = function(){ var ga = document.createElement(‘script‘); ga.type = ‘text/javascript‘; ga.async = true; ga.src = (‘https:‘ == document.location.protocol ? ‘https://ssl‘ : ‘http://www‘) + ‘.google-analytics.com/ga.js‘; var s = document.getElementsByTagName(‘script‘)[0]; s.parentNode.insertBefore(ga, s); } })(); |
1
2
3
|
$(document).ready(function() { alert("加载完成!"); }); |
1
|
< script type="text/javascript" src="xxx.js" async="async"></ script > |
1
|
< script type="text/javascript" defer></ script > |
1
|
< script type="module" src="XXX.js"></ script > |
1
2
3
4
|
< script type="module"> import utils from "./utils.js"; // other code </ script > |
标签:firefox ready tac util UNC dde cti 兼容 list
原文地址:https://www.cnblogs.com/jayfeng/p/12458082.html