✍ 📁 🙈 🙉 🙊
HTML
window Resize
html 測試 左入右出
!>
html 測試 上入下出
!>
html 測試 單入單出
!>
html 測試 左單右單
!>
顯示具有
get IP
標籤的文章。
顯示所有文章
顯示具有
get IP
標籤的文章。
顯示所有文章
get IP
jquery Get IP https://api.ipdata.co cckedit
Your Ip Address :
https://api.ipify.org/?format=json
<
h1>Your Ip Address : <
span class="ip"><
/span><
/h1>
<
script src="https://code.jquery.com/jquery-3.4.1.min.js" > <
/script>
<
script>
$(document).ready(function() { $.getJSON("
https://api.ipify.org/?format=json
",
function(e) { $('.ip').text( e.ip ); });
<
/script>
00
Your Ip Address :
https://jsonip.com?callback=?
<
h1>Your Ip Address : <
span class="ip"><
/span><
/h1>
<
script src="https://code.jquery.com/jquery-3.4.1.min.js"> <
/script>
<
script>
$.getJSON("
https://jsonip.com?callback=?
", function(data) {
$('.ip').text(data.ip); });
<
/script>
00
https://ipinfo.io
$.getJSON("https://ipinfo.io", function (data) {....}
<
h1>https://ipinfo.io<
/h1>
<
div id="D1"><
/div>
<
div id="D2"><
/div>
<
div id="D3"><
/div>
<
script src="https://code.jquery.com/jquery-3.4.1.min.js" > <
/script>
<
script>
var obj ;
$.getJSON("https://ipinfo.io", function (data) {
$("#D1").html( "JSON.stringify(data) = " + JSON.stringify(data))
$("#D2").html( "
Object.keys(data).length = " + Object.keys(data).length) ;
$("#D3").html( "<
br> data.ip = " + data.ip +
"<
br> data.hostname = " + data.hostname +
"<
br> data.city = " + data.city +
"<
br> data.region = " + data.region +
"<
br> data.country = " + data.country +
"<
br> data.loc = " + data.loc +
"<
br> data.org = " + data.org +
"<
br> data.timezone = " + data.timezone +
"<
br> data.readme = " + data.readme ) ;
})
<
/script>
00
<
script src="
https://secure.geobytes.com/GetCityDetails?key=7c756203dbb38590a66e01a5a3e1ad96&callback=var%20
cck
%20
"> <
/script>
00
http://ipinfo.io/json
<
div id="DP1"><
/div>
<
script>
function ipinfo(cb, ip) {
var request ;
// Mozilla, Safari, ...
if (window.XMLHttpRequest){ request = new XMLHttpRequest(); }
// IE
else if (window.ActiveXObject){
try { request = new ActiveXObject('Msxml2.XMLHTTP'); }
catch (e) {
try { request = new ActiveXObject('Microsoft.XMLHTTP');}
catch (e) {} } } ;
request.open("GET", '//ipinfo.io/' + ((ip) ? ip : ''), false) ;
request.setRequestHeader("Accept", "application/json") ;
request.onreadystatechange = function() {
if (request.readyState == 4 && request.status == 200)
{ cb(request.responseText); } } ;
request.send(null);
}
ipinfo(function(response) { DP1.innerHTML = response; });
<
/script>
00
http://ipinfo.io/json
<
div id="DP1"><
/div>
<
script>
function ipinfo(cb, ip) {
var request = new XMLHttpRequest();
request.open("GET", '//ipinfo.io/' + ((ip) ? ip : ''), false);
request.setRequestHeader("Accept", "application/json");
request.onreadystatechange = function() {
if (request.readyState == 4 && request.status == 200)
{ cb(request.responseText); } };
request.send(null);
}
ipinfo(function(response) { DP1.innerHTML = response; });
<
/script>
00
Edit
#html
#網頁格式
#style
#div
#textarea
#獲取 IP
#IP address data
較舊的文章
首頁
訂閱:
文章 (Atom)