I’ve just been looking at the index.html that comes with the EmberJS starter kit that you get by clicking “Download Starter Kit” on http://emberjs.com/
There is a bit of a strange bit of the code at the end of the body tag (loading scripts at the last moment):
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"></script>
<script>!window.jQuery && document.write(unescape('%3Cscript src="js/libs/jquery-1.6.1.min.js"%3E%3C/script%3E'))</script>
<script src="js/libs/ember-0.9.5.min.js"></script>
<script src="js/app.js"></script>
Ok I understand the last two, load the ember library and then run the ember app. I also understand the first one, get the jQuery from Google’s CDN but I don’t understand why you would ever have the second script tag! Is this just so that you don’t depend on Google’s CDN and ship your own copy of jQuery?
Can someone tell me if this is best practice or if I should be filing a bug with EmberJS so that they remove this from their starter kit.
Thanks
I think the author is thinking that in case jquery is unable to load from the googleapis then to be safe include a local version. Notice the