Eric LoCascio
Status: New User - Welcome
Joined: 11 Dec 2007
Posts: 4
Back to top
Posted: Dec 11, 07, 16:03    Javascript Cookie to skip Splash Page
Hello - first time posting on your forum. I have to admit I mainly do flash and 3D animation, so my brain doesn't work the way yours does for programming - in other words, I'm not that good at it.

I have a client that wants a cookie placed on his splash page that has an intro on it - to skip the intro splash page for 24 hours and go to the homepage if the intro has been viewed . I found this great script on your site, that I think will work perfectly.

[link]

I read over it and get that you have to basically put in the 4 values for the function Set_Cookie. I downloaded the script and it's probably obvious, but I'm just not sure where to put it. In the javascripts that I have implemented in the past part goes in the heading and part goes directly in the body.

Any help would be much appreciated, and I thank you for your time. ;-)

- Eric LoCascio
[link]
jeffd
Status: Assistant
Joined: 04 Oct 2003
Posts: 583
Back to top
Posted: Dec 11, 07, 17:41    
Take a look at this page, which sets a test cookie, and shows some sample cookie setting code.

Call the cookie function either as a library file, like so:

:: Code ::
<script type="text/javascript" src="/js/javascript_cookies.js"></script>

Or just include the whole code block on the page, in the page <head>

Personally, I wouldn't use javascript, I'd set this server side, and do it dynamically, Javascript cookies are remarkably inelegant compared to say php cookie handling.
Eric LoCascio
Status: New User - Welcome
Joined: 11 Dec 2007
Posts: 4
Back to top
Posted: Dec 11, 07, 23:09    
Hi Jeff - thank you very much for taking the time to answer my question - I know it is probably annoying people coming in here that are clueless w/ programming asking for help, but I am kind of in a bind and your help is much appreciated. ;-)

Thanks again,
Eric
Eric LoCascio
Status: New User - Welcome
Joined: 11 Dec 2007
Posts: 4
Back to top
Posted: Dec 12, 07, 10:01    
hello - I made the changes on the cookie.js file and uploaded it. As follows...

function Set_Cookie( 'sfscookie', 'visited 9 times', 30, '/', '','' ) {


I have this in the head of the index.html page

<script type="text/javascript" src="/cookie.js"></script>

But it isn't working when I test it - what an I not getting? ;-)

Thanks you,
Eric
jeffd
Status: Assistant
Joined: 04 Oct 2003
Posts: 583
Back to top
Posted: Dec 12, 07, 14:21    
Well, to use programming, you have to do a few things: learn the basics; read sample working code; learn to test and debug. Programming is something that takes work and practice, it's not really something you can just start doing without any training.

Or you can get someone else to do it for you, your flash stuff looks pretty good.

In your case, for example, you broke the existing code completely, replaced variable parameters with hard coded parameters, so basically nothing at all will work any more.

See your sticky.
Eric LoCascio
Status: New User - Welcome
Joined: 11 Dec 2007
Posts: 4
Back to top
Posted: Dec 12, 07, 14:32    
Hi Jeff - thanks for the response. That's nice, I ruined a great script someone took hours and hours to create that quickly. ;-) Thanks for the compliment on the flash stuff - that and 3D animation are my areas, [link] and there is constant learning with all that just to keep up, so I wish I had the time to put into learning programming, but I just don't. So I'll take your advice -what would you charge to do it... that is if you were even willing to do it. If not, is there anyone you could recommend that would implement it into the site for me? Thanks again, for your time.

-Eric[/url]
Display posts from previous:   

All times are GMT - 8 Hours