Add comments to this Code, hoping to help you.
<Script type = "text/javascript" charset = "UTF-8">
(Function (){
Var doc = document, // define an alias for the document object. Local variable access speed is faster than global
Wa = doc. createElement ('script'), // create a <script> tag
S = doc. getElementsByTagName ('script') [0]; // find the first <script> tag, which may be its own
Wa. type = 'text/javascript '; // Add attributes to the newly created <script> tag. The Tag: <script type = "text/javascript">
Wa. charset = 'utf-8'; // set the charset attribute for the tag. <script> do not need this attribute?
Wa. async = true; // I don't know what this is. I have never seen it before.
Wa. src = ('https: '= doc. location. protocol? 'Https: // ': 'http: //') + 'js .t.sinajs.cn/open/analytics/js/suda.js? Version = 20111118190824. js ';
// Add the src attribute to the <script> label, URL. If the protocol of the current document is https, https: // otherwise http: // then link the js path js.t.sinajs.cn/open/analytics/js/suda.js? Version = 201111182.16.js
// The tag becomes
// <Script type = "text/javascript" charset = "UTF-8" async = "true" src = "http (s): // js.t.sinajs.cn/open/analytics/js/suda.js? Version = 201111184252.16.js"> </scr EPT> // here I manually add a space, otherwise it will conflict with the end tag of the last script. Please note that
S. parentNode. insertBefore (wa, s) ;}) (); // Add this tag to the back of the first <script> tag on the page,
/*
The entire function is included in an anonymous function to avoid conflicts with external variable names.
The whole process is a process of dynamically loading external js files. The advantage of this is that the browser will download js files in parallel to speed up page loading.
In fact, it is better to unmount the references of those doc files at the end,
Doc = null;
Wa = null;
S = null;
*/
</Script>
From Hurry's column