Related Categories: jQuery, Tips
Fear not, all is not lost. Using the code below, we can try to load the file from the Google CDN and then quickly test if it successfully loaded. If it did load properly, we don't do anything different. But if it didn't, we can load the file from another location, assumingly our web server. Then our site will function properly and once Google's CDN is re-accessible, visitors will continue to benefit from the use of the CDN.
- if (typeof jQuery === 'undefined') document.write("<scr"+"ipt src='jquery-1.3.2.min.js'></scr"+"ipt>");
- $('#test_id').append('test test test');
- <span id="test_id">
You need to login to post a comment.