Created
December 11, 2013 21:33
-
-
Save alycda/7918835 to your computer and use it in GitHub Desktop.
http://writing.colin-gourlay.com/safely-using-ready-before-including-jquery/
http://samsaffron.com/archive/2012/02/17/stop-paying-your-jquery-tax
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // put this in head. | |
| <script type='text/javascript'>window.q=[];window.$=function(f){q.push(f)}</script> | |
| // anywhere throughout the body. | |
| <script> | |
| $(function(){ | |
| // call jQuery before it's loaded. | |
| }); | |
| </script> | |
| // put this at end of document. | |
| <script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> | |
| <script>window.jQuery || document.write('<script src="_/vendor/jquery-1.10.2.min.js"><\/script>')</script> | |
| <script>$.each(q,function(i,f){$(f)});</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment