コードは、以下のすべてのブラウザで正常に動作しますが、iphoneで、それは常にエラーを表示し、ステータスが0AjaxのPOSTメソッドは、Oエラーを表示し、すべてのブラウザ
$.ajaxSetup({
"Access-Control-Allow-Headers": "*",
"cache-control":"no-cache",
"Access-Control-Allow-Methods": "POST, OPTIONS",
"Access-Control-Allow-Origin":"url",
beforeSend:function(xhr){
alert("before send");
xhr.setRequestHeader("content-Type","application/json; charset=utf-8");
$.support.cors = true;
cache = false;
async =false;
crossOrigin = true;
crossDomain = true;
processData = false;
},
complete:function(result,status,errorThrown){
console.log(result);
alert("complete============ "+status);
alert("after complete");
e.preventDefault();
},
error:function(result,status,errorThrown){
alert("i am in error block");
alert(status);
alert(errorThrown);
alert(result.status);
$.each(result, function(i, item) {
alert(i +" ============="+ item);
});
},
});
var data = JSON.stringify({"loginName":mobile,"password":mobile,"firstName":fname,"middleName":Mname,"lastName":Lname,"mobileNo":mobile,"emailId":emailid,"gender":gen,"customer":{"customerType":994,"businessType":businessType,"residenceType":ResidentialType,"ownerType":OwnerType,"address":address,"blockId":blockId},
});
$.post('url',data, function(result,status,errorThrown){
console.log(result);
console.log("success status========"+status);
console.log("succes status thrown =========="+errorThrown.status);
alert("success");
//location.href="index.html";
console.log(data);
},'json');
ようこそスタックオーバーフロー。 [ツアー](http://stackoverflow.com/tour)にアクセスし、[ヘルプセンター](http://stackoverflow.com/help)にアクセスしてください。[よく質問するにはどうすればよいですか?](http ://stackoverflow.com/help/how-to-ask)。 – MJH