【问题标题】:Input search not working in Edge, IE, or Firefox输入搜索在 Edge、IE 或 Firefox 中不起作用
【发布时间】:2019-08-12 05:29:27
【问题描述】:

搜索栏适用于 Chrome 和 Opera,但不适用于上述浏览器。我建议它与onsearch="search(event)" 有关。

Mozilla 说它不受支持,我想知道是否有人知道此问题的解决方案?

HTML:

<input
    type=search
    name=""
    id="filterSearch"
    placeholder="Search for events, seasonal meals or simply list ingredients"
    onsearch="search(event)"
>

【问题讨论】:

  • By the sounds of this 看起来它只是一个美化的 onsubmit(你的表单),如果输入是一个数字增量器,它听起来像是一个超时的 onkeyup 功能

标签: javascript html django firefox search


【解决方案1】:

Internet Explorer、Firefox 或 Opera 12 及更早版本不支持 onsearch 事件。 尝试使用 onchange、onkeyup 等

<input type=search name="" id="filterSearch" placeholder="Search for events, seasonal meals or simply list ingredients" onchange="search(this.id)">

【讨论】:

  • 我在上面说明了这一点,因为我向 Mozilla 展示了这一点。你有解决办法吗?
  • 检查我上面的编辑,onchange的工作方式类似于onsearch
猜你喜欢
  • 2016-04-03
  • 2020-06-04
  • 2018-06-08
  • 2020-02-19
  • 2017-10-19
  • 2018-06-04
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多