« 上一篇下一篇 »

加载动态JS


// 加载javascript
function getJsurl(url,jsid)
{   var Ran = Math.round(Math.random()*1000)
    var Now = new Date();
 var Num = Now.getSeconds();
 var JsId = "Id_"+jsid+"_"+Num+"_"+ Ran;
 var oHead = document.getElementsByTagName("head").item(0);
 var oScript = document.createElement("script");
 var oldJs = document.getElementById(JsId)
    if (!oldJs)
 {
        oScript.language = "javascript";
        oScript.type = "text/javascript";
        oScript.id = JsId;
        oScript.defer = true;
        oScript.charset = "gb2312";
        oScript.src = url;
        void(oHead.appendChild(oScript));
 }
}

Leave a Comment

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。