javascript - how to record open html page time and close page time and store in txt,csv file -
i want record duration of date , time of web page open , close., store data in txt file., ex: start date time , end date time
<script type="text/javascript"> var starttime = new date(); //start clock! window.onbeforeunload = function() //when user leaves page(closes window/tab, clicks link)... { var endtime = new date(); //get current time. var timespent=(endtime - starttime); //find out how long it's been. alert(timespent); //pop window time spent in microseconds. }
Comments
Post a Comment