我尝试解析ip。我使用jquery ajax get从url中获取数据,但在控制台中,有-unaucept令牌:意外的SyntaxError<
$.get("http://tools.whois.net/whoisbyip/", function (response) {
console.log(response);
}, "jsonp");我有可用的代码:
$.get("http://ipinfo.io", function (response) {
}, "jsonp");但我没有得到我需要的所有信息。
发布于 2014-08-12 22:15:33
尝试使用以下代码:
$.get("http://ip-api.com/json", function (response) {
console.log(response);
}, "json");我将"jsonp“改为"json”:)。
您的第一个URL“tools.whis.net/whoisbyip/”响应出现错误,而另一个URL "ipinfo.io“没有返回任何内容。
示例:http://api.jquery.com/jquery.get/ (在网站末尾)
https://stackoverflow.com/questions/25265693
复制相似问题