As a novice in JavaScript and web technologies, I am currently working with JSON files from another domain. I am attempting to make a cross-domain request by using YQL as a proxy. Although I acknowledge that my code may not be the most elegant at this point, I am open to improving it with your assistance.
Here is the current state of my code:
function GetUrl() {
var link = "http://m.airpim.com/json/public/search?q=variabile&k=&e=1",
name = document.id('s').get('value') || '*';
return link.replace("variabile", name);
}
function Ricerca() {
var yql = 'http://query.yahooapis.com/v1/public/yql?q=' + encodeURIComponent('select * from json where url="' + GetUrl() + '"') + '&format=json&diagnostics=false&callback=';
return yql;
}
function LavoroJson() {
var ciao = new Request.JSONP({
url: Ricerca(),
onComplete: function(data) {
// Log the result to console for inspection
alert(ciao.toSource());
}
}).send();
}
Despite my intention to make the JSON request using YQL, it seems that the current implementation is not functioning properly. What steps can I take to address this issue?