代码:
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');
}
}
$(document).ready()
不工作;当我的页面加载时,我没有收到显示“测试”的警报。帮助?
我已经包含了 jQuery。