How to postpone JavaScript parsing For 2 scripts on a page, Jquery is loaded first and its plugin the second. I tried to do so
<script type='text/javascript'> (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = "http://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js" var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.defer= true; ga.src = "http://site.ru/js/plagin.js" var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); </script>
but console error Uncaught ReferenceError: $ is not defined - plagin.js