<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 中的页面搜索中的查找的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                  相关文档推荐

                  Fetch multiple links inside foreach loop(在 foreach 循环中获取多个链接)
                  Backbone Fetch Request is OPTIONS method(Backbone Fetch Request 是 OPTIONS 方法)
                  Fetch API leaks memory in Chrome(Fetch API 在 Chrome 中泄漏内存)
                  How can I download and save a file using the Fetch API? (Node.js)(如何使用 Fetch API 下载和保存文件?(Node.js))
                  Send blob data to node using fetch, multer, express(使用 fetch、multer、express 将 blob 数据发送到节点)
                  Sending a custom User-Agent string along with my headers (fetch)(发送自定义用户代理字符串以及我的标头(获取))
                • <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>