已阻止跨源请求:同源策略禁止读取位于 http://www.imooc.com/data/sport.json 的远程资源。(原因:CORS 头缺少 'Access-Control-Allow-Origin')。
2015-05-24
$("li:gt(3)").hide();
$("li:last").show();
$("a").click(function(){
if($("a").html() == "更多"){
$("li:gt(3)").show();
$("li:last").show();
$("a").html("简化");
}else{
$("li:gt(3)").hide();
$("li:last").show();
$("a").html("更多");
}
})
$("li:last").show();
$("a").click(function(){
if($("a").html() == "更多"){
$("li:gt(3)").show();
$("li:last").show();
$("a").html("简化");
}else{
$("li:gt(3)").hide();
$("li:last").show();
$("a").html("更多");
}
})
最赞回答 / 不断滴自我催眠
错误太多了··你自定义的jquery方法 得加个方法名啊 内容写到方法里li_col=(li_col==undefined) ? def_col;lst_col; //def_col后面的应该是冒号而不是封号$(this).css("background-color":li_col); //里面的应该是 逗号而不是冒号最后})(jQuwery) 这里应该是 jQuery<...code...>
2015-05-23