0

I am working on a firefox extension. And for some odd reason when I make a ajax call the callback success (the results of success was the list I was looking for but not for complete) will not run, but complete will. With that said, on the server I am returning a array, which is transformed in json. If I must use the complete callback, can I get that list still? Thanks!

$.ajax({
            type: "GET",
            dataType:'json',
            url: "http://api.com/data/album",
            complete: function (result) {//success not working
          //GET THE LIST RESULT HERE



            }
        });//End Ajax call to get albums
6
  • I'd add an error handler. Sounds like the request is erroring Commented Apr 29, 2013 at 1:47
  • Could you show us how exactly are you sending the array, and how are you trying to handle it? Commented Apr 29, 2013 at 1:49
  • Ok I will add that, should have been there in the first place. But surprised it would not work for FF ext but work for chrome. Commented Apr 29, 2013 at 1:49
  • @kilkadg I am returning a List<info> from the server. Works fine when testing. Commented Apr 29, 2013 at 1:54
  • If you do not write the code it is difficult to understand Commented Apr 29, 2013 at 2:00

1 Answer 1

1

complete is called irrespective of success or error : http://api.jquery.com/jQuery.ajax/

A function to be called when the request finishes (after success and error callbacks are executed).

If success is not getting called and complete is , then error must be getting called and you need to check the cause of the error.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.