http://www.depressedpress.com/DepressedPress/Content/ColdFusion/Essays/GIFAs
Pipe/Index.cfm
Basically it describes a simple technique (and offers sample code) to allow
you to write information back to the server without needed a page refresh.
This will let you notify the server whenever your client-side controls are
clicked (and, in your case, presumably save them).
As an added bonus you could also use the technique to track which of your
client-controlled content elements are being used most. This is always one
of the problems with dynamic, client-side code - you often lose the metrics
needed to determine usage patterns and content popularity.
Of course if ALL you want to do is save state this technique may be going a
little overboard - there's really no reason for CF to be involved at all
since _javascript_ can access cookies just as well as anything - you could
just store the information you want in a cookie (as an aside even with this
method CF can still catch the information since the cookies set client-side
will be sent to the server on the next request).
Hope this helps,
Jim Davis
_____
From: Jim McAtee [mailto:[EMAIL PROTECTED]
Sent: Sunday, April 04, 2004 3:03 AM
To: CF-Talk
Subject: Keeping state with _javascript_
Maybe not the best subject line. Here's what I'm trying to do:
I've got a CF generated page that uses _javascript_ & CSS to expand &
contract (hide & unhide, actually) several blocks containing numerous html
links. When the user expands a block and then clicks a link, the new URL
is displayed in the same windows (target=_top).
Right now what happens is that when the user returns to the page, all of
the blocks are reset to their contracted (hidden) state. That's as
expected. For convenience, what I'd like to do is maintain the state of
the page for a short time period, say 5 minutes, in case the user comes
back to the main page. Which is very likely since it's the topmost
launching page for a host of related applications. If for instance there
were three such expandable blocks on the page, I'd need CF to see three
variables (or elements of an array or struct) that contain the state of
the three blocks so that I could set their CSS 'display' property
accordingly when generating the page.
Any ideas how I might do this?
_____
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]