地理位置対応のcountry_nameはChromeとFirefoxでは動作していますが、Safariでは動作していません。これをどうすれば解決できますか?地理位置対応country_nameがSafariで動作しません
Javascriptを:
$.get("http://freegeoip.net/json/", function (response) {
$("#ip").html("IP: " + response.ip);
$("#country_code").html(response.country_code);
if(response.country_code=='NL'||response.country_code=='US'){
document.getElementById(response.country_code).style.display = "block";
}
}, "jsonp");
HTML:
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div id="NL">THE NL</div>
<div id="US">THE US</div>
CSS:
#NL { display:none;}
#US { display:none;}
サファリにいくつかの広告ブロックプラグインがありますか? –
アクティブな広告ブロッカーはありません。しかし、要素を調べるとSafariは次のエラーを出します:[警告] [ブロック] http://freegeoip.net/jsonから安全でないコンテンツを実行することが許可されていません –