Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

javascript detect time on page

$(document).ready(function() {
  var start = new Date();

  $(window).unload(function() {
      var end = new Date();
      $.ajax({ 
        url: "log.php",
        data: {'timeSpent': end - start},
        async: false
      })
   });
});
Comment

PREVIOUS NEXT
Code Example
Javascript :: component navigation without changin the url react router 
Javascript :: javascript class in external file 
Javascript :: json stringify empties the array in js 
Javascript :: sum all odd in binary search tree recursion javascript 
Javascript :: convert datetime value to time only in reactjs 
Javascript :: javascript closest child 
Javascript :: uploading json data to s3 bucket in node js 
Javascript :: express fingerprint 
Javascript :: esx global error 
Javascript :: var s= 
Javascript :: next greater element javascript using stack 
Javascript :: loop number in react 
Python :: jupyter ignore warnings 
Python :: python get appdata path 
Python :: postgres django settings 
Python :: selenium Keys enter python 
Python :: how to iterate through files in a folder python 
Python :: check python 32 or 64 
Python :: string to datetime convert 
Python :: remove all pycache files 
Python :: zsh: command not found: virtualenv 
Python :: clear outpur jupyter 
Python :: pylsp install 
Python :: how to feature selection in python 
Python :: split validation set 
Python :: cube finder python 
Python :: cv2 crop image 
Python :: loop through list backwards python 
Python :: export image png python 
Python :: python subprocess.run output 
ADD CONTENT
Topic
Content
Source link
Name
4+7 =