json (IP DATA) を取得し、AJAX を使用してデータ (GEO IP) を取得する Javascript を作成しようとしています。
$(document).ready(function(){
var path_to_the_webservice = "http://www.pathtothescript.com/check.php";
$.ajax({
url: path_to_the_webservice,
success: function(html)
{
if(html)
{
alert('3');
$('#content').append(html);
}
else
{
alert('4');
}
}
});
});
そして、アラート(4)が表示されます。なぜですか?
基本的にhttp://www.pathtothescript.com/check.php
、ブラウザからアクセスすると、解析する必要がある JSON を取得します
$.getJSON(path_to_the_json,
function(data)
{
$.each(data, function(i,item)
{
});
}
しかし、私はそれを作る方法がわかりません。
jsonはこんな感じhttp://j.maxmind.com/app/geoip.js
何か助けはありますか?ありがとう!