Public · Protected · Private
load jQuery locally when CDN fails
Type: Public  |  Created: 2012-08-16  |  Frozen: Yes
« Previous Public Blog Next Public Blog »
Comments
  • A fall back of CDN can be done banking on two ro more sites.

    Ideally you will verify if jquery object is not null. else load it from else where.

    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"></script>
    <script type="text/javascript">
    if (typeof jQuery == 'undefined')
    {
    document.write(unescape("%3Cscript src='Scripts/jquery.1.5.1.min.js' type='text/javascript'%3E%3C/script%3E"));
    }
    </script>
    2012-08-16 10:34
This blog is frozen. No new comments or edits allowed.