Featured post
php - Check if user hits back button in browser -
i'm trying use javascript onbeforeunload event ask user if want exit page, don't want event fire (edit: "the event" being dialog box pops asking user click ok leave site or click cancel stay on current page) if user hits button since staying on site.
so there way tell if user has hit button using javascript or php?
i've gotten solution using hidden iframe works in ie, need can work firefox, chrome, , safari if possible.
edit: ie solution works because when user hits button iframe sent parent page remains @ same spot. can tell user has indeed hit button, use history.back(). little hack doesn't work in other browser (to knowledge), i'm looking cross-browser solution.
tl;dr i'm using window.onbeforeunload pop dialog asking users if want leave site or not. don't want pop when user hits button. how can tell user has hit button in browser?
thanks, rick
short answer:
no.
long answer:
noooooooooooooooooooooooooooo.
please don't try keep users on website unless have very reason to. saving form fields example of use. checking if they're moving on website bad use.
people don't travel page-to-page as did in days of web. instead use google , social networks find interesting pages, , consume separate distinct pieces of information.
- Get link
- X
- Other Apps
Comments
Post a Comment