I have a strange problem. I have to load jquery twice and then it only works.
In the head of my html I load jquery:
<script src="https://code.jquery.com/jquery-latest.min.js"></script>
At the end of the html file I put the document ready function:
<script type="text/javascript">
$(document).ready(function(){
Code...
});
</script>
In the console of my browser I get the error: Uncaught TypeError: $ is not a function. So jquery is not correct loaded.
When I load jquery twice everything works fine:
<script src="https://code.jquery.com/jquery-latest.min.js"></script>
<script src="https://code.jquery.com/jquery-latest.min.js"></script>
Does anyone have any idea what is going wrong here. Is this because jquery has not yet loaded before we get to the document ready function? Perhaps a delay needs to be built in?