1. 程式人生 > >thinkPHP中ajax請求例項(寫法)

thinkPHP中ajax請求例項(寫法)

 個人站點 :http://oldchen.iwulai.com/    

$(function(){                              //當頁面(文件)載入完畢就執行
    $('#send').click(function(){           //點選事件觸發Ajax
         $.ajax({
             type: "GET",                  //提交方式
             url:'Admin/controller/fun',   //介面路徑TP是(模組/控制器/方法)
             data:{sid: sid},              //需要提交的資料多個用,隔開{sid: sid, eid: eid}
             dataType: "json",             //資料格式
             success: function(data){}
         });
    });
});