PDA

View Full Version : I need someone's help on this Javascript


intensecool
07-13-2010, 04:37 PM
Okay Guys,

Here is the query.

I am having my forum on vbulletin & I am trying to run a javascript on the showthread page.
All i want is that the javascript should execute only ONCE per user session & should repeat itself in sometime like 7 days or so.

What can be done..??
I need some kind of COOKIE solution for this..!!

Help me on this.
Regards

Guest190829
07-14-2010, 04:57 AM
Javascript has full access to document cookies. Here's an articles about cookies and Javascript:

http://www.elated.com/articles/javascript-and-cookies/

You can set the cookie in your script, and do a conditional too see if the browser has a valid, unexpired cookie before evaluating the rest of the code.

You have to be careful though because cookies aren't that reliable; for instance if the user uses a different browser the code will run.