0

当我运行滑块时,我有一个带有垂直滑块的网页,它正在更改 URL。我想在页面刷新时删除一些文本。就像我有一个 URL 95.0.4.12/inner/innerpage3.html 并且当我使用滑块时,它正在将此 URL 更改为 inner/innerpage3.html#slide4 或任何滑块编号

<script type="text/javascript">
$(function (){
var top= window.top.location.href;
window.onload=$(document).scrollTop(0)
})
</script>
4

2 回答 2

1

您可以使用document.location.hash以下方法:

hash属性返回 URL 的锚点部分,包括井号 (#)。

$(function (){
    document.location.hash = ""
})
于 2012-07-23T06:02:57.773 回答
1

您可以使用window.location.hash来更改 URL 的哈希部分。您还可以使用document.referrer来检测用户来自哪张幻灯片。

于 2012-07-23T06:03:36.860 回答