所以我有一个显示在每个页面上的图像,但是我想编写一个脚本,根据页面的不同,用另一个图像替换该图像。我如何以编程方式确定我所在的页面?我已经可以进行实际的图像替换。
最佳答案
您可以使用位置
<script type="text/javascript">
alert(window.location);
// and you can set the location to move to another page
window.location = "http://stackoverflow.com"
</script>
关于Javascript 确定我在哪个页面,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10149274/