私はjavascriptの学習を開始し、以下のコードを書きました。
var dataFetch = $.getJSON("http://localhost:12345/stream", function (Data) {
alert(Data);
$.each( Data, function () {
alert(this);
$("<li>").html(this.rss).prependTo(tweetList);
});
});
dataFetch.done(function () {
alert("done");
});
dataFetch.fail(function () {
alert("fail");
});
http://localhost:12345/stream
ブラウザにリンクを配置すると、次のようになります。
{"rss":{"version":"2.0","channel":{"title":"Dave Winer","link":"http://scripting.com/","description":"Dave Winer's \"Scripting News\" weblog, started in April 1997, bootstrapped the blogging revolution.","language":"en-us","copyright":"Copyright 2012 Scripting News, Inc.","pubDate":"Mon, 08 Oct 2012 04:00:00 GMT","lastBuildDate":"Mon, 08 Oct 2012 18:12:27....
........... much more here
しかし、このhtmlファイルを実行すると、警告ダイアログボックスが失敗して失敗します。
JSON.stringify(some_json_object).
node.jsサーバーコードからローカルホスト上のデータを送信しています。
エラーは何ですか?