views:

178

answers:

1

I use http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js but some compaty may block this site, so in this case I want to use my local version on jquery /JavaScripts/jquery.min.js. How can I do it?

+1  A: 
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);

Kind Regards

--Andy

jAndy