If you don’t specify a date when creating a cookie, it will only last one session. Prototype and Cookiejar.js make cookies a very neat thing to work with.
http://scripty.walterdavisstudio.com/last-viewed/session.html
To do this in Freeway with Protaculous, first use the External JavaScript Action to link cookiejar.js into your page. (You can download it from my example above at:
http://scripty.walterdavisstudio.com/last-viewed/javascripts/cookiejar.js
Next, apply Protaculous to your page, choose prototype-packed from the library picker, and click on the top Function Body button. Paste in the following JavaScript code:
jar = new CookieJar({
expires: '',
path: '/'
});
if(!jar.get('sawit')){
jar.put('sawit',true);
}else{
$('message').hide();
}
Now choose your div and make sure that it is named ‘message’ in the Title field of the Inspector.
That’s all there is to it.
Walter
On Mar 19, 2012, at 12:19 PM, pems wrote:
Hi everyone just a question about sessions cookies
I want to be able to show a specific div only once, per browser session. Obviously a session cookie is the way to go and ideally I would like to be able to link it to the div and not just its contents. I have had a look at a few example methods but they tend to be timed and ideally I would prefer it to be non timed (so if the users quits the browser the div would be visible again but just the once). Most examples I have seen on the net tend to be written in bespoke javascript and I was hoping there was an easy method to do this using Scripty.
Any help would be very kindly received and appreciated
Pems
freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options
freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options