Skip to main content

Bug Tracker

Side navigation

#4897 closed enhancement (fixed)

Opened July 14, 2009 02:50AM UTC

Closed January 12, 2011 05:54PM UTC

Last modified March 13, 2012 06:02PM UTC

REST-style JSONP callback option

Reported by: dandv Owned by:
Priority: high Milestone: 1.5
Component: ajax Version: 1.3.2
Keywords: ajaxrewrite Cc:
Blocked by: Blocking:
Description

I'm trying to get cross-domain JSONP data from this API: http://judstephenson.com/programming/2008/11/realtime-stock-quotes-api-updated

Unfortunately, the API is not standard in accepting a ?callback=foo parameter, but rather requires appending 'foo' to the URL:

http://judstephenson.com/api/Quotes/Realtime/aapl/json/foo

I've tried to use jquery.getJSON, but the way of specifying a callback is restricted to the "url?callback=?" scheme. I would need just "url/?".

Proposal: to accommodate REST APIs, if the URL ends in '/?', getJSON should simply replace the '?' with the callback name.

Attachments (0)
Change History (6)

Changed July 15, 2009 10:17PM UTC by jaubourg comment:1

You might wanna give jquery-jsonp a try:

http://code.google.com/p/jquery-jsonp/

Check the TipsAndTricks wiki page especially.

Changed November 18, 2010 03:26AM UTC by dmethvin comment:2

status: newopen

Changed November 18, 2010 03:26AM UTC by dmethvin comment:3

milestone: 1.41.5

Changed December 27, 2010 10:36PM UTC by rwaldron comment:4

keywords: → ajaxrewrite

Changed January 12, 2011 05:54PM UTC by jaubourg comment:5

resolution: → fixed
status: openclosed

Fixes #4897. Added ?? as a context-insensitive placeholder for the callback name of a JSONP request. Unit tests provided.

Changeset: 0c51e9d55f39366cab14719b80cb7e989c716351

Changed January 31, 2011 04:27PM UTC by john comment:6

priority: majorhigh