【发布时间】:2018-02-18 07:34:56
【问题描述】:
使用 Javascript 如何检查当前 URL 是否包含哈希?
在测试页面中我想添加一个 Javascript 代码来打印:
<p>yes, there is a hash here</p>
如果存在哈希(当前页面http://www.example.com/test/#abc)或:
<p>no, there is no hash here</p>
如果哈希不存在(当前页面http://www.example.com/test/)。
【问题讨论】: