So I got an alertbox that shows your current time spent on the page.. the problem is that if it goes over 60 seconds it does not reset to 0 seconds. I dont know how to fix that and I didnt find any solution by searching... my current code:
var d = new Date();
var elapsed = new Date() - d;
var seconds = parseInt(elapsed / 1000);
var minutes = parseInt(seconds / 60);
alert("Time spent on page: " + minutes + " Minute/s " + seconds + " Scond/s");
Common logic problem. Just take the remainder.