Skip to content

Instantly share code, notes, and snippets.

@paulo72
Last active December 19, 2015 04:59
Show Gist options
  • Select an option

  • Save paulo72/5901510 to your computer and use it in GitHub Desktop.

Select an option

Save paulo72/5901510 to your computer and use it in GitHub Desktop.
Make a queue for $ so we can start calling jquery without worrying whether its there at all. We'll pop the queue once we know jquery is loaded.
<!--
Make a queue for $ so we can start calling jquery without
worrying whether its there at all. We'll pop the queue once we know
jquery is loaded.
Put this bit in the head
-->
<script type='text/javascript'>window.q=[];window.$=function(f){q.push(f)}</script>
<!-- ... and this bit before the closing body tag, after jQuery is loaded ... -->
<script type="text/javascript">$.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