【问题标题】:Href modal redirect problem only with google chrome?Href 模态重定向问题仅适用于谷歌浏览器?
【发布时间】:2020-04-14 10:37:32
【问题描述】:
<a href="#" class="btn btn-brand btn-elevate btn-icon-sm" data-toggle="modal" data-target="#contractFiltrModal">

顶部是我打开模态的按钮,但它一直将我重定向到 # 个页面,而不是打开我的模态。此问题仅在 Google Chrome 中出现,但在 Safari 等其他网络浏览器上运行良好。

如果我在我的按钮中删除 href="#",模式会正常工作,但会出现错误“未捕获的类型错误:无法在 HTMLAnchorElement 读取属性 'replace' of null。”。

有什么解决办法吗?

【问题讨论】:

  • 尝试使用
  • 移除href并使用按钮标签

标签: html laravel bootstrap-modal href


【解决方案1】:

试试吧。

<button type="button" class="btn btn-brand btn-elevate btn-icon-sm" data-toggle="modal" data-target="#contractFiltrModal">
  Button Name
</button>

Document

【讨论】:

    猜你喜欢
    • 2013-08-05
    • 1970-01-01
    • 2013-06-17
    • 2011-01-31
    • 2012-09-19
    • 2018-04-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多