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

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -