Saturday 15 March 2014

javascript - jQuery never calls .done() or .always() for ajax call -



javascript - jQuery never calls .done() or .always() for ajax call -

i'm having simple request:

$.get('ri/i18n/locale') .done(function() { console.log(this); }) .fail(function() { console.log(this); }) .always(function(){ console.log(this); });

unfortunately none of handlers ever called.

i cann confirm calling ri/i18n/locale in browser returns valid json string. i'm using jquery 1.11.1 .

any ideas what's wrong?

your issue might version of jquery using. before jquery 1.5, jqxhr object not returned $.get(), allows utilize promise behavior. the relevant jquery documentation.

javascript jquery ajax

No comments:

Post a Comment