开发者

Detect for website change via javascript / jquery

Is it possible to check if the browser user has opened a new tab, is closing (not minimizing) the current tab/page, or changing the url? Don't worry, nothing suss it's just for a novelty website. Could someone let me know if this is/isn't feasible via javascript (preferably jquery), and if so, what method to look into. Thanks

EDIT: I开发者_高级运维n the end it was easier to check if the mouse went above the window with the following code:

    $(window).bind("mouseout", function(e)
    {
    if (e.pageY < 0)
        {
            alert('you are leaving the page');
        }
    });


It is somewhat feasible using the unload event.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜