Tôi có jQuery tải tốt, tôi đã kiểm tra gấp bốn lần, mặc dù tôi nhận được lỗi này trong FireBug "$ không phải là một chức năng" và mã của tôi không hoạt động.
Dưới đây là mã của tôi:
<script type="text/javascript">
$("ol li:nth-child(1)").addClass('olli1');
$("ol li:nth-child(2)").addClass("olli2");
$("ol li:nth-child(3)").addClass("olli3");
$("ol li:nth-child(4)").addClass("olli4");
$("ol li:nth-child(5)").addClass("olli5");
$("ol li:nth-child(6)").addClass("olli6");
$("ol li:nth-child(7)").addClass("olli7");
$("ol li:nth-child(8)").addClass("olli8");
$("ol li:nth-child(9)").addClass("olli9");
$("ol li:nth-child(10)").addClass("olli10");
$("ol li:nth-child(11)").addClass("olli11");
$("ol li:nth-child(12)").addClass("olli12");
$("ol li:nth-child(13)").addClass("olli13");
$("ol li:nth-child(14)").addClass("olli14");
$("ol li:nth-child(15)").addClass("olli15");
$("ol li:nth-child(16)").addClass("olli16");
$("ol li:nth-child(17)").addClass("olli17");
$("ol li:nth-child(18)").addClass("olli18");
$("ol li:nth-child(19)").addClass("olli19");
$("ol li:nth-child(20)").addClass("olli20");
</script>
nơi là mã, liên quan đến khi bạn l oad các kịch bản jQuery? – RPM1984
Bạn có thể xác nhận trong firebug rằng jquery được tải không? Bạn có thể hiển thị 'đầu' của bạn không? –
jQuery được tải trong tiêu đề và tập lệnh này ở chân trang, vì vậy đây không phải là vấn đề – Alex