Posted in Javascript onFebruary 13, 2012
解决方法,用以下方法加载js:
var loadScript = function(url, callback, charset){ var head = document.getElementsByTagName('head')[0]; var script = document.createElement('script'); if(charset){ script.charset = charset; } script.src = url; if(!callback){ return; } script.onload = script.onreadystatechange = function(){ if(!this.readyState || this.readyState==='loaded' || this.readyState==='complete'){ callback(); } }; head.appendChild(script); };
jQuery.getScript加载同域JS的代码
声明:登载此文出于传递更多信息之目的,并不意味着赞同其观点或证实其描述。
Reply on: @reply_date@
@reply_contents@