$.ajax({
type: "GET",
url: "http://myweb/php",
success: function (data){
alert(data);
},
error:function(xhr,textStatus,err)
{
alert("readyState: " + xhr.readyState);
alert("responseText: "+ xhr.responseText);
alert("status: " + xhr.status);
alert("text status: " + textStatus);
alert("error: " + err);
}
});
And the result I get is:
readyState:0
responseText:""
status:0
text status:error
error:""
I try add header in my php, but still not working. The ajax code work before i update my xcode to 7.0 and ios simulator to 9.0.
header('Content-Type: application/json');
header('Access-Control-Allow-Origin: *');