I've been experimenting with jQuery on Codecademy, however after downloading the library it does not seem to be working.
I followed these steps:
- I downloaded jQuery 1.9.1 from http://jquery.com/download/ (http://code.jquery.com/jquery-1.9.1.min.js more specifically)
- I renamed the file jquery.js and placed it in the same source folder as my HTML / script etc.
- I linked to it in my HTML file
<script src='jquery.js'> </script>
- My script which used jQuery does not work. I tried a basic test in order to see if jQuery was working correctly -
$(document).ready(function(){ alert("Hello jQuery"); });
Is there something I have missed?
(My code works perfectly well on Codecademy, so I think it is very unlikely to be an issue elsewhere in my program)
Edit 1:
(Full code, for those asking :) )
HTML / jQuery
<script src='jquery.js'>
$(document).ready(function() {
alert("Hello jQuery!");
$('.matchtile').click(function() {
$(this).fadeTo('slow', 0);
});
$('.button').click(function() {
fadeIn();
});
});
function fadeIn(){
$('.matchtile').fadeTo('slow', 1);
}
</script>
<title></title>
</head>
<body>
<div class="matchtile"></div>
<div class="matchtile"></div>
<div class="matchtile"></div>
<div class="matchtile"></div>
<div class="button"></div>
</body>
CSS
.matchtile {
border-radius: 100%;
background-color: #FF0000;
width: 30px;
height: 30px;
margin: 30px;
}
.button {
background-color: #663333;
width: 30px;
height: 30px;
border-radius: 10%;
margin: 30px;
}