I've come across a fairly normal problem, but I can't solve it.
I tried to fix the jQuery scripts dozens of times, but it just won't work. It suddenly just stopped working after a few weeks.
I am positive that I included the jQuery script, and I did test if the site was alive.
However, it seems like my browser or server ain't loading it with the site load...
It load my Google Analytics script perfectly fine, but it won't load the jQuery script. Even if I host i myself.
This is the code
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" type="text/javascript"></script>
<script src="scripts/ganalytics.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function(){
$('img').hover(function(){
$(this).data('jpg', $(this).attr('src'));
$(this).attr('src',$(this).data('gif'));
},
function(){
$(this).attr('src',$(this).data('jpg'));
});
});
</script>
Here, it produces the error on line #5 or line #15 in my website
I am lost here, how do I fix this? It was working great, and then suddenly, boom, out of nothing, it stopped working. Have been trying to fix this, but I can't figure it out.
Cheers, thanks for reading
EDIT: Included a JSFiddle as it was requested in the comments. Hope I included the necessary code.