【问题标题】:Click Event Hash # URL单击事件哈希 # URL
【发布时间】:2021-10-04 18:54:58
【问题描述】:

您好,我有这个 URL example.com,其中有一个名为 <div class="terminosycondiciones"</div>

此 div 调用条款和条件的弹出窗口。

当用户将其放入浏览器时,我只需要使用 url 调用此弹出窗口 example.com#termsandconditions

我会这样做吗?

【问题讨论】:

    标签: jquery url hash


    【解决方案1】:
    if(
        window.location.hash &&
        window.location.hash.substring(1) === 'termsandconditions'
    ) {
        // Do your stuff
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-12-03
      • 1970-01-01
      • 2017-02-24
      • 2014-06-06
      • 2021-08-26
      • 2014-12-02
      • 2016-06-01
      • 2012-05-28
      相关资源
      最近更新 更多