我使用http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js 但有些compaty可能会阻止这个网站,所以在这种情况下我想在jquery上使用我的本地版本 /JavaScripts/jquery.min.js。 我该怎么办?
答案 0 :(得分:1)
if(typeof(jQuery) === 'undefined'){
var scr = document.createElement('script');
scr.setAttribute('type', 'text/javascript');
scr.setAttribute('src', 'http://yourdomain/jquery.min.js');
document.getElementsByTagName('head')[0].appendChild(scr);
setTimeout(function(){
// $(document).ready(); here for instance
}, 3000);