什么知道請求獲取的文件類型是json
<div id="divtest">
? ? ? ? ? ? <div class="title">
? ? ? ? ? ? ? ? <span class="fl">我的個人資料</span>?
? ? ? ? ? ? ? ? <span class="fr">
? ? ? ? ? ? ? ? ? ? <input id="btnShow" type="button" value="加載" />
? ? ? ? ? ? ? ? </span>
? ? ? ? ? ? </div>
? ? ? ? ? ? <ul></ul>
? ? ? ? </div>
? ? ? ??
? ? ? ? <script type="text/javascript">
? ? ? ? ? ? ?$(function () {
? ? ? ? ? ? ? ? $("#btnShow").bind("click", function () {
? ? ? ? ? ? ? ? ? ? var $this = $(this);
? ? ? ? ? ? ? ? ? ? $.get("http://www.xianlaiwan.cn/data/info_f.php",function(data){
? ? ? ? ? ? ? ? ? ? ? ? $this.attr("disabled", "true");
? ? ? ? ? ? ? ? ? ? ? ? $("ul").append("<li>我的名字叫:" + data.name + "</li>");
? ? ? ? ? ? ? ? ? ? ? ? $("ul").append("<li>男朋友對我說:" + data.say + "</li>");
? ? ? ? ? ? ? ? ? ? }, "json");
? ? ? ? ? ? ? ? })
? ? ? ? ? ? });
? ? ? ? </script>
2017-10-07
?$.get("http://www.xianlaiwan.cn/data/info_f.php",function(data){
? ? ? ? ? ? ? ? ? ? ? ? $this.attr("disabled", "true");
? ? ? ? ? ? ? ? ? ? ? ? $("ul").append("<li>我的名字叫:" + data.name + "</li>");
? ? ? ? ? ? ? ? ? ? ? ? $("ul").append("<li>男朋友對我說:" + data.say + "</li>");
? ? ? ? ? ? ? ? ? ? }, "json");
這里看得出來是get ?json