$("#btnShow").bind("click", function () { var $this = $(this); $.getJSON("http://www.xianlaiwan.cn/data/sport.json",function(data){ $this.attr("disabled", "true"); $.each(data, function (index, sport) { if(index==3) $("ul").append("<li>" + sport["name"] + "</li>"); }); }); });
2017-01-08
為什么將data: {num: $("#txtNumber").val()}這句也放到setup里面,輸出就不對了。
2017-01-08
把$(this).html("數據請求完成!");換成$(this).remove(); 就行了
2017-01-07
請求輸入一個數字
11
你輸入的 2 是 偶數 你輸入的 123 是 偶數 你輸入的 1233 是 偶數 你輸入的 23 是 偶數 你輸入的 3 是 偶數 你輸入的 11 是 偶數
11
你輸入的 2 是 偶數 你輸入的 123 是 偶數 你輸入的 1233 是 偶數 你輸入的 23 是 偶數 你輸入的 3 是 偶數 你輸入的 11 是 偶數
2017-01-05