jq中查询IP地址

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0,maximum-scale=1.0,user-scalable=no">
<title>Title</title>
</head>
<body>
您当前的IP地址为<p></p>
</body>
<script src="jquery-1.11.3.js"></script>
<script>
var url = 'http://chaxun.1616.net/s.php?type=ip&output=json&callback=?&_=' + Math.random();
$.getJSON(url, function(data) {
document.querySelector('p').innerHTML=data.Ip;
});
</script>
</html>
posted @ 2017-03-31 11:46  风的味道真好闻  阅读(640)  评论(0编辑  收藏  举报