I want to load jQuery with a fallback solution and have come across two different solutions:
1:
<script src="//ajax.googleapis.com/ [...] jquery.js"></script>
<script> window.jQuery || document.write('<script src="js/jquery.js"><\/script>') </script>
2:
<script src="//ajax.googleapis.com/ [...] jquery.js"></script>
<script> if ( typeof jQuery == "undefined" ) document.write('<script src="js/jquery.js"><\/script>') </script>
What's the difference between these snippets and which solution would be the preferred one?