Detect URl Bar click event or user typing in Browser address bar with Jquery/java-script

こ雲淡風輕ζ 提交于 2019-12-13 18:11:46

问题


I am working on a project where I need to Interact with browser Url bar. I mean I need too detect event with jquery/JS as soon as user clicks on address bar or type in there or if user clicks on another tab so to use with with callback and do the stuff. I know the browser is a OS app and has its own control but is there a way to accomplish this? Right now I am just detecting if user leaves Html from upper position.

Here is the code

co$(window).mouseleave(function(e){
    if(e.pageY<5)
    {
        //do stuff;
    }
});

Any thoughts will be appreciated


回答1:


Unfortunately, you cannot tell when the user is interacting with the address bar.



来源:https://stackoverflow.com/questions/18640382/detect-url-bar-click-event-or-user-typing-in-browser-address-bar-with-jquery-jav

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!