My code is:
var test = "it isn't working";
var response = $.ajax({
type: 'GET',
url: 'jquerydemo.php', //This is in the same site as the page calling this request, so it's not a same-domain error.
success: function(){
test = "it's working";
},
error: function(){
alert("Error detected");
}
}).responseText;
alert(test);
I tested the status code and it came out to a 200 and the error function never goes off, but neither does the success function. Like I said in my comment, it isn't a same-origin policy error. It just stays saying "it isn't working". What's going on here?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…