Redfox
Redfox

Reputation: 1034

jquery ajax call doesn't fire error callback

Hi everyone I am using PhoneGap 1.5.0 with jQuery 1.6.4 and jQuery Mobile 1.0.1 and am trying to do a simple ajax call for an xml file. It all works well on success but if I change the URL or the credentials to invalid values the error method is not called.

$
        .ajax({
            url : "url be here",
            dataType : "xml",
            contentType : 'application/xml',
            username : username,
            password : password,
            success : function(xmlData, textStatus, xhr) {
              //this is triggered on success
            },
            error : function(XMLHttpRequest, textStatus, errorThrown) {
              //this is never called
            }
        });

I can't figure out, what I am doing wrong here. :(

Upvotes: 0

Views: 572

Answers (1)

Royi Namir
Royi Namir

Reputation: 148524

change the error function signature to :

  function( jqXHR, error_textStatus, errorThrown)

Upvotes: 1

Related Questions