Check if html 5 washer is loaded

Usually we check if jQuery is loaded from the CDN or not, and drops to the local version if it is not.

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="js/libs/jquery-1.7.1.min.js"><\/script>')</script>

I am using twitter bootstrap and it loads the html 5-way gasket from the copy googlecode.

<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>

Is it possible to somehow return to the local version if it does not boot from googlecode

Or am I doing something wrong. Should I check this out?

+5
source share
4 answers
<script>window.html5 || document.write('<script src="js/libs/your-local-version.js"><\/script>')</script>
+11
source

I would not come back using jQuery (a long discussion and the possibility of worms, which I would prefer not to open), but it is up to you.

, html5.js googlecode , . ? SVN. / , . Googlecode... , .

+4
+4

When using html5shim, I would recommend downloading it locally first. On their website, they recently changed the wording so that you upload a file instead of a hotlink from GitHub, which might contain unverified code.

+1
source

All Articles