Code:
var names = [
'Abstract',
'Animals',
'Beach',
//etc. (removed because it was too long)
'Volcano'
];
var links = [
'http://i.imgur.com/MFkuQ.jpg',
'http://i.imgur.com/QEt72.png',
'http://i.imgur.com/nmrqv.jpg',
//etc. (removed because it was too long)
'http://i.imgur.com/7uy15.png'
];
$(document).ready(function() {
alert('test');
for (i = 0; i < names.length; i++) {
var row = document.createElement('tr');
var col = document.createElement('td');
col.appendChild(document.createTextNode(names[i]));
row.appendChild(col);
document.getElementById('imagenametable').appendChild(row);
}
});
function expandbar(s) {
resetbars();
$('#' + s).show('slow');
}
function resetbars() {
for (i = 1; i <= 3; i++) {
$('#sec' + i).hide('slow');
}
}
The $(document).ready() is not working; I do not get an alert that says ‘test’ when my page loads. Help?
I have included jQuery.
should be:
The script has to be loaded AFTER jQuery.
I found this code in http://pastebin.com/raw.php?i=YeZ77WNr which he posted in another question