User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the JavaScript / DHTML / AJAX section within the Web Development category of DaniWeb, a massive community of 391,625 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,688 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JavaScript / DHTML / AJAX advertiser: Lunarpages Web Hosting

Quick Help for Cookie script?

Join Date: Jul 2006
Location: Deptford, London
Posts: 936
Reputation: MattEvans has a spectacular aura about MattEvans has a spectacular aura about 
Rep Power: 5
Solved Threads: 47
Moderator
Featured Poster
MattEvans's Avatar
MattEvans MattEvans is offline Offline
Posting Shark

Re: Quick Help for Cookie script?

  #4  
Jan 21st, 2007
Sorry, I missed a bit of code you wrote in the original post:

You do this test in the ReDirect function:

if(Splash == "TRUE"){ };

that test should be a test for Splash NOT being "TRUE". Otherwise; your redirect will only happen when the user has visited the page at least once.

The cookie code your using should return a null if the cookie isn't found; but perhaps it's better to test for it not being "TRUE" just in case.

So, the top part of your code should read:

var Splash = GetCookie('SplashSkip');
ReDirect('/welcome');
function ReDirect (URL) {
if (Splash != 'TRUE') {
SetCookie('SplashSkip','TRUE',1);
window.location=(URL);
}
}
Last edited by MattEvans : Jan 21st, 2007 at 1:23 pm.
If it only works in Internet Explorer; it doesn't work.
Reply With Quote  
All times are GMT -4. The time now is 12:41 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC