//异步加载js  
    function loadScript(url,callback){  
        var script = document.createElement("script");  
        script.type="text/javascript";  
        if(script.readyState){  //IE
            script.onreadystatechange = function(){  
                if(script.readyState=="loaded"||script.readyState=="complete"){  
                    script.onreadystatechange=null;  
                    callback();  
                }  
            }  
        }else{  //Others: Firefox, Safari, Chrome, and Opera
            script.onload = function(){  
            callback();  
        }  
        }  
        script.src = url;  
        document.getElementsByTagName("head")[0].appendChild(script);  
    }  

【未完待续】

posted on 2015-07-14 16:47  狂流  阅读(130)  评论(0编辑  收藏  举报