#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")
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
Component: | unfiled → ajax |
---|
comment:2 Changed 13 years ago by
comment:3 Changed 12 years ago by
Priority: | → undecided |
---|---|
Resolution: | → invalid |
Status: | new → closed |
Closing as the original ticket submitter has not responded to a request to clarify further information on the original bug in 2 months.
Are the multiple "?" is the querystring the problem here?