<html><script> var xhr = new XMLHttpRequest();xhr.open(‘GET‘, "http://ipinfo.io/json", true);xhr.send(); xhr.onreadystatechange = processRequest; function processRequest(e) { if (xhr.readyState == 4 && xhr.status == 200) { ???????var response = JSON.parse(xhr.responseText); ??????????alert(response.ip); ???}}</script></html>
xmlhttp js 请求
原文地址:https://www.cnblogs.com/xiaobaichuangtianxia/p/10148870.html