Blog

HomeDevelopmentjQuery JSON YQL issue

jQuery JSON YQL issue

I’ve been working on YQL (Yahoo Query Language). Using jQuery to retrieve the JSON result, it managed to retrieve the response from Yahoo but would not execute the success function.

[code]

var url = “http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20html%20where%20url%3D’http%3A%2F%2Ffinance.yahoo.com%2Flookup%3Fs%3Dknm%20and%20xpath%3D’%2F%2Fdiv%5B%40id%3D%22yfi_sym_results%22%5D%2Ftable%2Ftbody%2Ftr’&format=json&env=http%3A%2F%2Fdatatables.org%2Falltables.env&callback=cbfunc”;

$.getJSON( url, function(data){
alert(data.query.results);
})

[/code]

After some search, the issue is cause by the callback in the URL. Changing the url to &callback=? solve the problem

Post Tags - , , ,

Written by

The author didnt add any Information to his profile yet