Click to See Complete Forum and Search --> : cookie help


chadypu
08-11-2003, 10:35 PM
i am creating a stylesheet picker and so far i have the stuff that changes the stylesheet... now i am just gonna write a cookie so that i can use this stylesheet on every page
here is what i have so far


<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<SCRIPT>
//the cookie functions
//--------------------
function setredcookie()
{

}
//--------------------
//the styles
function redwhite()
{
with (document)
{
write('<title>Chadypu.com||Red and White</title>')
write('<style>')
write('BODY {Background:#CC0000; color:white}');
write('A:link {color:blue;}');
write('A:active {font-size:h4; text-decoration: underline}');
write('A:Visted {color:purple;}');
write('</style>');
write('<img src="../Images/Banner1.jpg">')
write('<BR>hello');
}
}
function bluewhite()
{
with (document)
{
write('<title>Chadypu.com||Blue and white</title>')
write('<style>')
write('BODY {Background:#6633FF; color:white}');
write('A:link {color:red;}')
write('A:active {text-decoration: underline}');
write('A:Visted {color:purple;}');
write('</style>');
write('<img src="../Images/Banner2.jpg">')
write('<BR>hello');
}
}
//--------------------
</Script>
</head>

<body bgcolor="#ffff00" text="#ff0000">


<h1>What theme would you like?</h1>
<A Href=javascript:redwhite()>White on Red</A><br>
<A Href=javascript:bluewhite()>White on Blue</A><br>
<A Href=mailto:kissfanchad@hotmail.com>I would like another style</A>
<b>
<br>test text
<br>[test]
</b>

</body>
</html>

as you can see i didnt get too far on function setredcookie
can someone atleast get me pointed in the right direction on what to do
i have never done anything with cookies before
all i wanna know is how i set the cookie and how i retrieve it
if someone could write something that would be great

pyro
08-11-2003, 10:43 PM
You might want to take a look at http://www.alistapart.com/issues/126/

chadypu
08-11-2003, 10:46 PM
i already looked at that

all i want is someone to get me in the right direction with these cookies

pyro
08-11-2003, 10:50 PM
I haven't personally read through this, but perhaps it will help you: http://www.webreference.com/js/column8/

chadypu
08-11-2003, 10:53 PM
ill read that but i would like someone just to show me, IMO tutorials suck

pyro
08-11-2003, 10:55 PM
I'm not a big fan of tutorial, either. Maybe you'd be interested in the documentation? http://devedge.netscape.com/library/manuals/2000/javascript/1.3/reference/document.html#1193577

chadypu
08-11-2003, 10:57 PM
ill read that too
thanks

pyro
08-11-2003, 11:05 PM
You're welcome... :)

chadypu
08-11-2003, 11:07 PM
you seem to be everywhere tonight :p

pyro
08-11-2003, 11:12 PM
lol... I find hanging out on here relaxing... :)

chadypu
08-11-2003, 11:13 PM
well i post alot on the IGN.com boards, i got 28k posts there :p
i find it fun i know what yuo mean
im going to bed now so yeah whatever