87864/how-to-detect-when-a-user-leaves-a-web-page-using-javascript
Hello @kartik,
Try the onbeforeunload event: It is fired just before the page is unloaded. It also allows you to ask back if the user really wants to leave.
Alternatively, you can send out an Ajax request when he leaves.
Hope it helps!!
Thank you!!
Hello @kartik, Instead of passing the entire object ...READ MORE
Hii @kartik, It is possible to list all ...READ MORE
Hello @kartik, Sending the data in your scenario,I ...READ MORE
Hello @kartik, Use window.open(): var win = window.open('http://edureka.co/', '_blank'); if (win) ...READ MORE
Hello, In the error callback or $.ajax you have three ...READ MORE
Hello @kartik, If your script is called myScript.js ...READ MORE
Hello @kartik, Try this code : // Create an ...READ MORE
Hello @kartik, Use node-inspector from any browser supporting WebSocket. Breakpoints, ...READ MORE
Hello @kartik, Use this: function is_touch_device() { ...READ MORE
Hii @kartik, Using javascript <script> $("a[href='#top']").click(function() { ...READ MORE
OR
Already have an account? Sign in.