<small id='CW6sw'></small><noframes id='CW6sw'>

<i id='CW6sw'><tr id='CW6sw'><dt id='CW6sw'><q id='CW6sw'><span id='CW6sw'><b id='CW6sw'><form id='CW6sw'><ins id='CW6sw'></ins><ul id='CW6sw'></ul><sub id='CW6sw'></sub></form><legend id='CW6sw'></legend><bdo id='CW6sw'><pre id='CW6sw'><center id='CW6sw'></center></pre></bdo></b><th id='CW6sw'></th></span></q></dt></tr></i><div id='CW6sw'><tfoot id='CW6sw'></tfoot><dl id='CW6sw'><fieldset id='CW6sw'></fieldset></dl></div>
    • <bdo id='CW6sw'></bdo><ul id='CW6sw'></ul>

    1. <tfoot id='CW6sw'></tfoot>
      <legend id='CW6sw'><style id='CW6sw'><dir id='CW6sw'><q id='CW6sw'></q></dir></style></legend>

      1. 有没有办法检测在 javascript 中的页面搜索中的查找

        Is there a way to detect find on the page searches in javascript(有没有办法检测在 javascript 中的页面搜索中的查找)

            <small id='quvwX'></small><noframes id='quvwX'>

          1. <tfoot id='quvwX'></tfoot>

              <bdo id='quvwX'></bdo><ul id='quvwX'></ul>
              1. <i id='quvwX'><tr id='quvwX'><dt id='quvwX'><q id='quvwX'><span id='quvwX'><b id='quvwX'><form id='quvwX'><ins id='quvwX'></ins><ul id='quvwX'></ul><sub id='quvwX'></sub></form><legend id='quvwX'></legend><bdo id='quvwX'><pre id='quvwX'><center id='quvwX'></center></pre></bdo></b><th id='quvwX'></th></span></q></dt></tr></i><div id='quvwX'><tfoot id='quvwX'></tfoot><dl id='quvwX'><fieldset id='quvwX'></fieldset></dl></div>
                <legend id='quvwX'><style id='quvwX'><dir id='quvwX'><q id='quvwX'></q></dir></style></legend>
                  <tbody id='quvwX'></tbody>

                  本文介绍了有没有办法检测在 javascript 中的页面搜索中的查找的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  每个浏览器都有在页面上查找功能 (ctrl+F).有没有办法检测 javascript 中的用户搜索,以便我可以附加其他操作.

                  each browser has find on page functionality (ctrl+F). Is there a way to detect user searches in javascript so that I could attach additional actions.

                  推荐答案

                  当然可以尝试hookctrl+fcmd+f 快捷方式,但即使它适用于某些"浏览器,这样您也只会知道用户按下了该快捷方式并且最有可能搜索某些内容.

                  Of course you can try to hook into ctrl+f or cmd+f shortcut, but even if that works on "some" browsers, that way you only would know that an user pressed that shortcut and is most likely to search for something.

                  如果浏览器允许覆盖该快捷方式,您可以进一步阻止默认行为并在网站上实现您自己的搜索逻辑.但这在大多数情况下被认为是非常糟糕的做法.覆盖本机浏览器行为非常糟糕.

                  If the browser allows to overwrite that shortcut, you could further block the default behavior and implement your own search logic on the site. But that is considered most times as very bad practice. Overwritting native browser behavior is pretty pretty bad.

                  另一方面,浏览器执行搜索过程时不会触发事件".简而言之,不,实际上没有办法使用 javascript 检测或挂钩搜索过程(如果有,它永远不会跨浏览器兼容).

                  On the other hand, there is no "event" which gets triggered when a browser executed a search process. In short words, no, there actually is no way to detect or hook into a search process with javascript (if there is one, it's never gonna be cross browser compatible).

                  这篇关于有没有办法检测在 javascript 中的页面搜索中的查找的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  在开发JS过程中,会经常遇到两个小数相运算的情况,但是运算结果却与预期不同,调试一下发现计算结果竟然有那么长一串尾巴。如下图所示: 产生原因: JavaScript对小数运算会先转成二进制,运算完毕再转回十进制,过程中会有丢失,不过不是所有的小数间运算会
                  问题描述: 在javascript中引用js代码,然后导致反斜杠丢失,发现字符串中的所有\信息丢失。比如在js中引用input type=text onkeyup=value=value.replace(/[^\d]/g,) ,结果导致正则表达式中的\丢失。 问题原因: 该字符串含有\,javascript对字符串进行了转
                  Rails/Javascript: How to inject rails variables into (very) simple javascript(Rails/Javascript:如何将 rails 变量注入(非常)简单的 javascript)
                  CoffeeScript always returns in anonymous function(CoffeeScript 总是以匿名函数返回)
                  Ordinals in words javascript(javascript中的序数)
                  getFullYear returns year before on first day of year(getFullYear 在一年的第一天返回前一年)
                • <small id='CzTNc'></small><noframes id='CzTNc'>

                    <tbody id='CzTNc'></tbody>
                        <bdo id='CzTNc'></bdo><ul id='CzTNc'></ul>

                        • <tfoot id='CzTNc'></tfoot>
                          <legend id='CzTNc'><style id='CzTNc'><dir id='CzTNc'><q id='CzTNc'></q></dir></style></legend>
                          <i id='CzTNc'><tr id='CzTNc'><dt id='CzTNc'><q id='CzTNc'><span id='CzTNc'><b id='CzTNc'><form id='CzTNc'><ins id='CzTNc'></ins><ul id='CzTNc'></ul><sub id='CzTNc'></sub></form><legend id='CzTNc'></legend><bdo id='CzTNc'><pre id='CzTNc'><center id='CzTNc'></center></pre></bdo></b><th id='CzTNc'></th></span></q></dt></tr></i><div id='CzTNc'><tfoot id='CzTNc'></tfoot><dl id='CzTNc'><fieldset id='CzTNc'></fieldset></dl></div>