Non-blocking dynamic loading of javascript ads. For more information, see.
The Code is as follows:
Ad code final loading
Script
// Ad ("open", 'alert ("ddd ")');
Var JSScript = {
Inject: function (htmlId, jsCode ){
Var script = document. createElement ("script ");
Script. text = jsCode;
Document. getElementById (htmlId). appendChild (script );
},
Loadeing: function (url, charset, callback ){
Var script = document. createElement ("script ");
Script. src = url;
Script. charset = charset;
Script. loaded = false;
Script. onload = function (){
Script. loaded = true;
Callback ();
};
Script. onreadystatechange = function (){
If (! Script. onloadDone & ("loaded" = script. readyState | "complete" = script. readyState )){
Script. onload ();
}
};
Document. getElementsByTagName ("head") [0]. appendChild (script );
}
}
JSScript. loadeing ("http://cbjs.baidu.com/js/s.js? 6.1.3 "," gb2312 ", initAd)
Function initAd (){
JSScript. inject ("open", 'Baidu _ CLB_singleFillSlot ("72893 ")');
}
Script