これはおそらく私が愚かであると確信していますが、この問題を確認したいと思います。Windows 8アプリを構築し、mysqlサーバーからデータを読み込んでいますが、この問題を修正できないようです。少し読んでみると、問題は、jsonリクエストがこれほど正しく、それを解決する方法がある前にコードが実行されていることだと思います。データを返し、それを表示する関数内にあるため、戻り値があります。「SampleItems[0]」は完全に表示されますが、json内のものは表示されませんが、コンソールログにはサーバーからデータを取得していることが示されます。助けてくれてありがとう!
var sampleItems = [];
sampleItems[0] = { group: sampleGroups[count], title: "New Image", subtitle: "", description: "", content: "", backgroundImage: "/images/add.png" };
//this code calls to our cloud based service which gets the data which is needed and returns it in a JSON object back for this to handle
$.getJSON('http://pumpstationstudios.com/tumapics/services/getimages.php', function (data) {
var service_url = 'http://pumpstationstudios.com/tumapics/';
var count = 1;
images = data.items;
$.each(images, function (index, image) {
image.image = service_url + image.image;
sampleItems[count] = { group: sampleGroups[count], title: "Hello", subtitle: "", description: "", content: "", backgroundImage: image.image };
count++;
});
});
return sampleItems;