success, error events aren't working for ajax
I have the following code:
$(document).ready(function(){
$.ajax({
url: "svc/GetTweetsByUser.php",
type: "POST",
success: function(data) {
alert('success');
},
failure: function(){
alert('fail');
},
data: ({twitter_user : 'AdoboHobo'}),
dataType: "xml"
开发者_JAVA百科 }
);//endof ajax
});
I'm kind of starting with web and ajax stuff... this worked perfectly by yesterday. I don't know what is happening now that neither success nor failure events are triggering. I'm shure that the request and response are perfectly working, I checked that with firebug.
Does anyone have any ideas for this? Thanks in advance.
use error:
instead!
$.ajax({
url : "svc/GetTweetsByUser.php",
type : "POST",
success : function(data) {
alert('success');
},
error : function() {
alert('failure');
},
data : ( {
twitter_user : 'AdoboHobo'
}),
dataType : "xml"
});
Isn't it error
instead of failure
?
精彩评论