この URL の JSON データを読むには本当に助けが必要です:
http://www.cloudspokes.com/members/ferbie12/past_challenges.json
--disable-web-security
クロスドメインの問題を解決するために Google Chrome で使用しようとしています。これは、JSON で単純な値を読み取るために作成したコードです。
$.getJSON("www.cloudspokes.com/members/ferbie12/past_challenges.json",function(data) {
$.each(data, function(){
var test = data.attributes.type;
$('p#success').append(test);
});
});
ブラウザには何も表示されません。本当に助けてくれてありがとう。
更新:これらのコードも使用してみました。まだ結果が出ていません。
$.ajax({
type: "POST",
url: "www.cloudspokes.com/members/ferbie12/past_challenges.json",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function(data) {
$.each(data, function(){
var test = data.attributes.type;
$('p#success').append(test);
});
itemAddCallback(data);
},
error: function (xhr, textStatus, errorThrown) {
$("#success").html(xhr.responseText);
}
});