|
Mailing Lists
|
Home /
Groups /
ColdFusion Talk (CF-Talk)
How do I track
Author: Daniel Farmer
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:32883#165052
True Enough...
NOT in the same statement (as in JT's code). You can't set a CF var to
the value of a JS var without making a request. Due to the nature of the
web, this is impossible!
> You are mixing Javascript (client side) and CF (server
> side) here. This
> simply won't work.
>
> I've mixed the two technologies before with no problems.
>
Author: Pascal Peters
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:32883#165049
NOT in the same statement (as in JT's code). You can't set a CF var to
the value of a JS var without making a request. Due to the nature of the
web, this is impossible!
> You are mixing Javascript (client side) and CF (server
> side) here. This
> simply won't work.
>
> I've mixed the two technologies before with no problems.
Author: Daniel Farmer
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:32883#165048
You are mixing Javascript (client side) and CF (server side) here. This
simply won't work.
I've mixed the two technologies before with no problems.
Thanks,
I got it working yesterday using a image.
JT
You are mixing Javascript (client side) and CF (server side) here. This
simply won't work.
On your original question. This is a hard thing to do. Why do you need
it? What do you mean by "How long someone has viewed a coldfusion page"?
Start when it loads in the browser? What is defined by page?
If you really need to do this, I would create a JS function to calculate
this: initialize the time in onload and calculate the difference in
onunload of the body. Then send a request through a popup or hidden
frame (or even an img src) to the server.
Pascal
> Hum...
>
> Why does this not work?
>
> <cfset session.timeFirstView = Now()>
>
> <cfscript>
>
> pagetime = structnew() ==> CF
>
> pagetime.FirstView = session.firstTimeView ==> CF
>
> pagetime. ExitTime = onunload(now()) ==> CF & JS
>
> pagetime.Visited = pagetime.Visited - pagetime.Firstview ==> CF
>
> alert(time.Visited) ==> JS
>
> </cfscript>
>
> Any help preciated,
>
> JT
Author: JT
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:32883#165047
Thanks,
I got it working yesterday using a image.
JT
You are mixing Javascript (client side) and CF (server side) here. This
simply won't work.
On your original question. This is a hard thing to do. Why do you need
it? What do you mean by "How long someone has viewed a coldfusion page"?
Start when it loads in the browser? What is defined by page?
If you really need to do this, I would create a JS function to calculate
this: initialize the time in onload and calculate the difference in
onunload of the body. Then send a request through a popup or hidden
frame (or even an img src) to the server.
Pascal
> Hum...
>
> Why does this not work?
>
> <cfset session.timeFirstView = Now()>
>
> <cfscript>
>
> pagetime = structnew() ==> CF
>
> pagetime.FirstView = session.firstTimeView ==> CF
>
> pagetime. ExitTime = onunload(now()) ==> CF & JS
>
> pagetime.Visited = pagetime.Visited - pagetime.Firstview ==> CF
>
> alert(time.Visited) ==> JS
>
> </cfscript>
>
> Any help preciated,
>
> JT
Author: Pascal Peters
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:32883#165045
You are mixing Javascript (client side) and CF (server side) here. This
simply won't work.
On your original question. This is a hard thing to do. Why do you need
it? What do you mean by "How long someone has viewed a coldfusion page"?
Start when it loads in the browser? What is defined by page?
If you really need to do this, I would create a JS function to calculate
this: initialize the time in onload and calculate the difference in
onunload of the body. Then send a request through a popup or hidden
frame (or even an img src) to the server.
Pascal
----- Excess quoted text cut - see Original Post for more -----
Author: JT
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:32883#164987
Hum...
Why does this not work?
<cfset session.timeFirstView = Now()>
<cfscript>
pagetime = structnew()
pagetime.FirstView = session.firstTimeView
pagetime. ExitTime = onunload(now())
pagetime.Visited = pagetime.Visited - pagetime.Firstview
alert(time.Visited)
</cfscript>
Any help preciated,
JT
you could set a session variable...
<cfset session.timeFirstView = Now()>
Then on an unload javascript event...to detect when the page is left and
have that
trigger a second Now() CF function, then you'd have the start and end
time.
How do I track How long someone has viewed a coldfusion page...any ideas
would be apprciated.
Author: Daniel Farmer
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:32883#164986
you could set a session variable...
<cfset session.timeFirstView = Now()>
Then on an unload javascript event...to detect when the page is left and have
that
trigger a second Now() CF function, then you'd have the start and end time.
How do I track How long someone has viewed a coldfusion page...any ideas
would be apprciated.
Author: JT
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:32883#164983
How do I track How long someone has viewed a coldfusion page...any ideas
would be apprciated.
|
May 24, 2012
|
Latest Fusion Authority Articles
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||