172
rated 0 times
[
176]
[
4]
/ answers: 1 / hits: 21173
/ 10 Years ago, tue, june 17, 2014, 12:00:00
I am getting this error while trying to set up a counter which calculates the total time taken to fill a particular form .Have tried the following things,
//script
var timeStart;
var timeStop;
$(document).load(function() {
timeStart = new Date();
});
$('#form_3').on('submit', function() {
timeStop = Math.round((timeStart.getTime() - new Date().getTime()) / 1000);
console.debug('time taken from load till submit: ' + timeStop);
});
//script
now getting error uncaught TypeError:Cannot read property 'getTime' of undefined.
More From » jquery