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
})
});
});
Also in JavaScript:
- JavaScript append text to div
- jsx-a11y/alt-text
- javascript send post data with ajax
- js numbers
- How do you wait for 5 seconds in JavaScript?
- getting whole json object
- embed discord.js
- how to make a vowel counter in javascript
- convert json to object jackson
- javascript find smallest number in an array
- redux connect
- dimensions react native
- javascript write to text file
- mlutiple css jquery
- petition the lord with prayer
- file input disable open file picker javascript
- js yesterday date
- how to add onclick event in javascript
- jquery parsexml get attribute
- single if statement js true false
- javascript get intersection of two arrays
- js get base url
- go to next route vuejs
- angular access current scope from console