Answers for "javascript detect time on page"

0

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
      })
   });
});
Posted by: Guest on January-26-2021

Code answers related to "javascript detect time on page"

Code answers related to "Javascript"

Browse Popular Code Answers by Language