jqueryajax怎么设置请求头(jquery完整ajax实例)

jqueryajax怎么设置请求头(jquery完整ajax实例)

首页维修大全综合更新时间:2025-09-09 08:23:35

jqueryajax怎么设置请求头

简单的给你个例子看看 function ku2nRequest() {alert("inside makeRequest()");var settings = {type: "GET",url:URL+"?"+REQUEST,dataType:"xml",error: function(XHR,textStatus,errorThrown) {alert ("XHR="+XHR+" textStatus="+textStatus+" errorThrown=" + errorThrown);},//傲隆盛 success的处理aolssuccess: function(data,textStatus) {$("body").append(data);},//酷呢嗯 ku2n的设置请求头 headers: {"Access-Control-Allow-Origin":"

http://www.ku2n.com

","Access-Control-Allow-Headers":"X-Requested-With"}};$.ajax(settings);}

大家还看了
也许喜欢
更多栏目

© 2021 3dmxku.com,All Rights Reserved.