Skip to content

return a jQuery promise from retrieveJSON #5

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

3 participants

@krisselden

No description provided.

@stilist
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

+1

@stilist
stilist commented Jan 5, 2012

Is this resolved by b2139ff?

@krisselden

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
Something went wrong with that request. Please try again.