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

return a jQuery promise from retrieveJSON #5

Open
krisselden opened this issue Nov 21, 2011 · 4 comments
Open

return a jQuery promise from retrieveJSON #5

krisselden opened this issue Nov 21, 2011 · 4 comments

Comments

@krisselden
Copy link

No description provided.

@stilist
Copy link

stilist commented Nov 30, 2011

+1

Was hoping to have drop-in optional caching, e.g.

xhr = if settings.cache then $.retrieveJSON(url) else $.getJSON(url)
xhr.done(settings.done).fail(settings.fail).always(settings.always)

But when the $.retrieveJSON path is hit I just get Uncaught TypeError: Cannot read property 'jquery' of undefined.

@craigspaeth
Copy link

+1

@stilist
Copy link

stilist commented Jan 5, 2012

Is this resolved by b2139ff?

@krisselden
Copy link
Author

Still doesn't look like the above example would work. That commit still requires a callback function. It also returns a promise that will never resolve, if you return false from your callback function if it is cached.

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

3 participants