0

please helppp :/ I swear to GOD this things was working yesterday pretty well. Just broke today, dont know why. but the done callback from $.ajax is not firing.

function check() {
                $.ajax({
                    url: "/statistics/setup-Table",
                    dataType : "json",
                    success: function(data){
                        alert("check "+data['total']);
                    }
                }).done(function(){
                    alert("done");
                }).fail(function(){
                    alert("fail");
                }).always(function(){
                    alert("always");
                });
            }

i only get one alert >> "check 24"

no alerts from done, fail or always pops up. even for the other $.ajax calls, callback functions are not getting fired. The url is fine too.

Thanks in advance.

Aman
  • 623
  • 1
  • 11
  • 23
  • 1
    I hope you have gone through this excellent post: http://stackoverflow.com/questions/14220321/how-to-return-the-response-from-an-ajax-call – HackerKarma Feb 20 '14 at 19:30
  • I did , but seems like all looks fine in this code. i get a response of 200 OK as well – Aman Feb 20 '14 at 19:34
  • 1
    BS i say. that shouldn't be possible. Check your console, there's likely an error. such as jqXHR.done is not defined (in the event you somehow loaded a really old version of jquery) – Kevin B Feb 20 '14 at 19:35
  • Works as expected in jsfiddle: http://jsfiddle.net/Tmw9w/ – uhleeka Feb 20 '14 at 19:37
  • $.ajax is broken by design. Do yourself a favor and wrap it for example to Q. – hequ Feb 20 '14 at 19:41
  • Cant thank you enough kevin... the cdn i was using were old version. which i inserted today. that would literally be the last place i would have looked. Thanks much man .. :D .. i just updated, alls working smoooth now ...!! :D – Aman Feb 20 '14 at 19:48
  • Thank you all for the response ... :D old version was the issue – Aman Feb 20 '14 at 19:49
  • @Aman the `console` should ALWAYS be the first place to look at ;) – Lucky Soni Feb 20 '14 at 20:04

1 Answers1

0

It was the version I was using of Jquery that messed things up. the CDN that is. Kevin B - thank you much .that really helped. Thank you to all the rest as well who looked into it for me . You guys r amazing, i love this community. i hope i can help back as well ..

later guys. :)

Aman
  • 623
  • 1
  • 11
  • 23