The
Adds a comment to your code, which I hope will help you.
<script type= "Text/javascript" charset= "utf-8"
(function () {
var doc = document,//define individual names for the document object. Local variable access faster than global
WA = doc.createelement (' script '),//Create a <script> tag
s = doc.getelementsbytagname (' script ') [0];//Find the first <script> tag, it is possible that it is its own
Wa.type = ' text/javascript ';//Add attributes to the <script> tag you just created, the label at this point: <script Type= "Text/javascript"
Wa.charset = ' utf-8 ';//Set CharSet property to label,<script> don't you need this?
Wa.async = true;//do not know what this is, have not seen
Wa.src = (' https: ' = = Doc.location.protocol? ' https://': ' http://') + ' js.t.sinajs.cn/open/analytics/js/suda.js?version=20111118190824.js ';
//Add src attribute to <script> tag, URL, if the current document's protocol is HTTPS https://otherwise http://then link to the path of JS Js.t.sinajs.cn/open/analytics/js /suda.js?version=20111118190824.js
//Finally this label becomes a
//<script type= "Text/javascript" charset= "Utf-8" async= " True "Src=" http (s)://js.t.sinajs.cn/open/analytics/js/suda.js?version=20111118190824.js "></SCR ipt>// I've manually added a space here.Grid, or it will conflict with the last script end tag, note
S.parentnode.insertbefore (WA, s);}) ()//finally add this tag to the first <script> label on the page, and
/*
The entire function is included in an anonymous function to avoid conflicts with the name of the variable in the outside world.
The whole process is a dynamic loading of external JS file process, the advantage is that the browser will download the JS file in parallel, speed up the loading speed of the page.
In fact, it is better to uninstall those doc references at the end,
doc = null;
WA = null;
s = null;
*/
</script>