Bug Tracker

Opened 13 years ago

Closed 12 years ago

Last modified 11 years ago

#6551 closed bug (invalid)

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.

Change History (4)

comment:1 Changed 13 years ago by dmethvin

Component: unfiledajax

comment:2 Changed 13 years ago by bullman

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

comment:3 Changed 12 years ago by addyosmani

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.

comment:4 Changed 12 years ago by jitter

#7694 is a duplicate of this ticket.

Note: See TracTickets for help on using tickets.