开发者

success, error events aren't working for ajax

开发者 https://www.devze.com 2022-12-28 10:15 出处:网络
I have the following code: $(document).ready(function(){ $.ajax({ url: \"svc/GetTweetsByUser.php\", type: \"POST\",

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?

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号