gpt4 book ai didi

javascript - 如何在页面上显示时间、日期 IP 和 URL?更新 - 2015 年 2 月 25 日

转载 作者:行者123 更新时间:2023-12-02 16:26:01 26 4
gpt4 key购买 nike

如何在特定时区的页面上显示时间和日期、显示访问该页面的计算机的 IP 地址以及显示该页面所在的 URL。

提前致谢,

吉姆

注意:这是编码的内容吗?

<script>
coding
</script>

最佳答案

获取 URL:window.location.toString()。您无法在 native JavaScript 中获取 IP 地址。要获取时间,请继续执行 Date()

var url = window.location.toString();
var time = Date();

alert(url);
alert(time);

关于javascript - 如何在页面上显示时间、日期 IP 和 URL?更新 - 2015 年 2 月 25 日,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28687957/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com