$("#btnShow").bind("click", function () {
$.getJSON("http://www.imooc.com/data/sport.json",function(data){
$(this).attr("disabled", "true"); //这行代码,为什么运行不了,如果先声明var $this=$(this) 用$this就可运行。
$.each(data, function (index, sport) {
$("ul").append("<li>" + sport["name"] + "</li>");
});
});
})
Caballarii
相关分类