Skip to main content

Bug Tracker

Side navigation

#6551 closed bug (invalid)

Opened May 09, 2010 08:29PM UTC

Closed October 15, 2010 03:53PM UTC

Last modified March 13, 2012 09:11PM UTC

jsonp without a defined callback name does not set the Accept headers properly

Reported by: joeshred Owned by:
Priority: undecided Milestone: 1.4.3
Component: ajax Version: 1.4.2
Keywords: ajax jsonp json Cc:
Blocked by: Blocking:
Description

Try using the $.getJSON(...) or $.ajax(... ,dataType: 'jsonp', ... ) without setting the callback=<x> (the <x> part), and the Accept Header is set to */*, instead of "application/json...".

Reproducable by this (Note that this serverside code does not yet handle the callback parameter, but am experimenting to allow cross domain script calls to our API).

This loads incorrect Accept Header (even though JQuery will generate a name for the callback method):

$.getJSON("https://api.globalgiving.org/api/public/projectservice/themes?api_key=e10c5e8e-730f-41c0-9b07-0983c94160a4&callback=?",

function(data){ alert("The Data is:"+data);});

This loads correct Accept header (by defining "callback=foo")

$.getJSON("https://api.globalgiving.org/api/public/projectservice/themes?api_key=e10c5e8e-730f-41c0-9b07-0983c94160a4&callback=foo",

function(data){ alert("The Data is:"+data);});

I have similar issues using the dataType: 'jsonp' and jsonpCallback: param's in the .ajax(...) call.

Attachments (0)
Change History (4)

Changed June 12, 2010 03:23AM UTC by dmethvin comment:1

component: unfiledajax

Changed August 07, 2010 04:54AM UTC by bullman comment:2

Are the multiple "?" is the querystring the problem here?

Changed October 15, 2010 03:53PM UTC by addyosmani comment:3

priority: → undecided
resolution: → invalid
status: newclosed

Closing as the original ticket submitter has not responded to a request to clarify further information on the original bug in 2 months.

Changed December 03, 2010 03:37PM UTC by jitter comment:4

#7694 is a duplicate of this ticket.