Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
所以我有一个显示在每个页面上的图像,但是我想编写一个脚本,根据页面将图像替换为另一个图像。我将如何以编程方式确定我在哪个页面上?我已经可以进行实际的图像替换。
你可以使用location
location
<script type="text/javascript"> alert(window.location); // and you can set the location to move to another page window.location = "http://stackoverflow.com" </script>