hash

作者: hanjy | 来源:发表于2016-03-16 10:30 被阅读0次

hash 属性是一个可读可写的字符串,该字符串是 URL 的锚部分(从 # 号开始的部分)。
语法

 location.hash=anchorname

实例
假设当前的 URL 是:

    location.hash=anchornamehttp://example.com:1234/test.htm#part2:

 <html><body><script type="text/javascript">
 document.write(location.hash);</script></body></html>

输出:

 #part2

相关文章

网友评论

      本文标题:hash

      本文链接:https://www.haomeiwen.com/subject/dypqlttx.html