this may stupid question, have read using "onbeforeunload" event (to detect when page closed or navigated away from) unreliable. i'm trying record event pageview tracking application. else thought of open web socket connection , record when connection closes. work or overkill , add unnecessary overhead page? app using javascript tracking code inserted page tracked , logging rails backend.
this indeed create overhead, may useful try jquery. see if following works you:
$("html").mouseleave(function(){ //do }); although may work when page navigated away from, not closed (although i'm not 100% sure on this), it's start.
Comments
Post a Comment