Highlighted

Can I add a timer feature to my coldfusion site?

New Here ,
Oct 07, 2015

Copy link to clipboard

Copied

I have a site built in coldfusion.  I want to add a feature to the site where the user can click a button and be directed to a page, when the new page opens a timer would start and when the user leaves that page then the timer would stop.  This would basically track the amount of time the user (a member of my organization) spent on this page.  Is it possible to add a timer feature like this to my site?

Views

156

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Can I add a timer feature to my coldfusion site?

New Here ,
Oct 07, 2015

Copy link to clipboard

Copied

I have a site built in coldfusion.  I want to add a feature to the site where the user can click a button and be directed to a page, when the new page opens a timer would start and when the user leaves that page then the timer would stop.  This would basically track the amount of time the user (a member of my organization) spent on this page.  Is it possible to add a timer feature like this to my site?

Views

157

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Oct 07, 2015 0
Advocate ,
Oct 07, 2015

Copy link to clipboard

Copied

This would have to be done on the client side, which means using JavaScript.

You don't actually need a timer, but you will have to notify the server when the user arrives on the page and when they leave. You would put the code in the onload() and onunload() events of the body element.

For modern browsers you could use WebSockets. For older browsers you could use Ajax.

Cheers

Eddie

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Oct 07, 2015 0