Danke für die erklärungen. ich hab jetzt versucht die ganze sache in eine unsichtbare div namens cand zu packen. leider (obwohl ich die daten auf meiner seite sehe wenn ich unsichtbar weg mache) hab ich das gleiche problem wie oben beschrieben.
function getData() {
var result = "";
var url = "http://query.yahooapis.com/v1/public/yql";
var symbol = 'AAPL';//$("#symbol").val();
var dateInput1 = '2015-01-01';
var dateInput2 = '2015-05-01';
var data = encodeURIComponent("select * from yahoo.finance.historicaldata where symbol = 'YHOO' and startDate = '2009-09-11' and endDate = '2010-03-10'");
var cand = document.getElementById("cand");
$.getJSON(url, 'q=' + data + "&format=json&diagnostics=true&env=http://datatables.org/alltables.env")
.done(function (data) {
result = data.query.results.quote[0].Close;
for(var i=1; i<data.query.count; i++) {
result += "," + data.query.results.quote[i].Close;
}
cand.innerText = result;
console.log("result",cand.innerText);
}
).fail();
result = cand.innerHTML.split(",");
var inhalt=document.getElementById('cand').innerText;
console.log("result",cand.innerText);
return result;
}
kennt ihr ne beschreibung wie man das mit diesen response löst? ich hab nur irgend welche http sachen dazu gefunden....