Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uncaught TypeError: Object #<Object> has no method 'success' #12

Closed
wwuck opened this issue Jan 29, 2013 · 3 comments
Closed

Uncaught TypeError: Object #<Object> has no method 'success' #12

wwuck opened this issue Jan 29, 2013 · 3 comments

Comments

@wwuck
Copy link

wwuck commented Jan 29, 2013

When I try to use this with jQuery 1.8.3, I get the following error:

Uncaught TypeError: Object # has no method 'success'

The error is thrown on https://github.com/paulirish/jquery-ajax-localstorage-cache/blob/master/jquery-ajax-localstorage-cache.js#L31

@Nevon
Copy link

Nevon commented Feb 19, 2013

I'm guessing you're invoking it like:

$.ajax({
    url: url,
    dataType: 'json',
    localCache: true,
}).done(function(data) {
    //Success callback
});

This plugin seems to assume that you're using the old-style success callback. I've spent a few hours today trying to convert it over to using deferred callbacks (.done, .fail, etc.) with little success. This is what I've got so far. The big problem is that the done callback is never run due to the abort method call. I quite frankly have no idea how to solve it, as I am pretty crappy at jQuery, but I'm hoping someone else will know.

This is also related to #13

@th3fallen
Copy link

@Nevon You can call the done method by doing return jqXHR.done(value)

@kayzee
Copy link

kayzee commented Jan 21, 2015

@th3fallen the cache function doesn't work with this solution because it still performs the AJAX call unless you call jqXHR.abort();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants