Side navigation
#12983 closed bug (notabug)
Opened November 29, 2012 05:42PM UTC
Closed November 29, 2012 05:51PM UTC
Last modified November 29, 2012 05:54PM UTC
$.getJSON or $.ajax with jsonp type, not returning data
Reported by: | hip_hop_x_ax@yahoo.com | Owned by: | |
---|---|---|---|
Priority: | undecided | Milestone: | None |
Component: | unfiled | Version: | 1.8.3 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
So this is the code, and the problem is that atleast with google suggestion it will never get to parse the function(data,status) no matter what. And bugzilla reports that the jsonp call is being made, that status is 200, and that there is a response.
Moreover i did try the same thing with $.ajax request on jsonp, the success case is never parsed.
$.getJSON('http://suggestqueries.google.com/complete/search?output=firefox&client=firefox&hl=en-US&callback=?&q=market', function(data,status){ $.each(data, function(i,item){alert(item.x);}); });
Attachments (0)
Change History (3)
Changed November 29, 2012 05:48PM UTC by comment:1
Changed November 29, 2012 05:51PM UTC by comment:2
resolution: | → notabug |
---|---|
status: | new → closed |
http://suggestqueries.google.com/complete/search?output=firefox&client=firefox&hl=en-US&callback=?&q=market returns a JSON object not a JSONP response (that is not a call to a function with the actual data as the first argument).
Please, look up the documentation for google's webservice to see if there is a way to request a proper JSONP response or ask for help on the jQuery forums.
Changed November 29, 2012 05:54PM UTC by comment:3
description: | So this is the code, and the problem is that atleast with google suggestion it will never get to parse the function(data,status) no matter what. And bugzilla reports that the jsonp call is being made, that status is 200, and that there is a response. \ Moreover i did try the same thing with $.ajax request on jsonp, the success case is never parsed. \ \ \ $.getJSON('http://suggestqueries.google.com/complete/search?output=firefox&client=firefox&hl=en-US&callback=?&q=market', \ function(data,status){ \ $.each(data, function(i,item){alert(item.x);}); \ }); \ → So this is the code, and the problem is that atleast with google suggestion it will never get to parse the function(data,status) no matter what. And bugzilla reports that the jsonp call is being made, that status is 200, and that there is a response. \ Moreover i did try the same thing with $.ajax request on jsonp, the success case is never parsed. \ \ {{{#!js \ $.getJSON('http://suggestqueries.google.com/complete/search?output=firefox&client=firefox&hl=en-US&callback=?&q=market', \ function(data,status){ \ $.each(data, function(i,item){alert(item.x);}); \ }); \ }}} |
---|
Note that alert(item.x) is fictional, even if a console.log inside function(data, status){} is more than enough to track if it's actually getting in that case (wich doesn't).