获取服务器IP地址的HTML代码示例
<!DOCTYPE html>
<html>
<head>
<title>Server IP</title>
</head>
<body>
<h1>Server IP Address:</h1>
<p id="ip"></p>
<script>
// Fetch the server IP address
fetch('https://api.ipify.org?format=json')
.then(response => response.json())
.then(data => {
document.getElementById("ip").textContent = data.ip;
})
.catch(error => console.error(error));
</script>
</body>
</html>
原文地址: https://www.cveoy.top/t/topic/o4aO 著作权归作者所有。请勿转载和采集!