views:

32

answers:

2

Hi everyone, 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"
    }
 );//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.

A: 

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"
    }
 );//endof ajax
aSeptik
Yeah.. ¬¬ so dumb. Thanks aSeptik, so I suppose that now I should figure out why is failing... Any ideas? Could be a malformed xml response?Anyway, you'll get the 'right answer', thanks dude!
Rigo Vides
+1  A: 

Isn't it error instead of failure?

j.