/    Sign up×
Community /Pin to ProfileBookmark

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

[I]<html>
<head>
<meta http-equiv=”Content-Type” content=”text/html; charset=iso-8859-1″>
<SCRIPT>
//the cookie functions
//——————–
[B]function setredcookie()
{

}[/B]
//——————–
//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:[email protected]>I would like another style</A>
<b>
<br>test text
<br>[test]
</b>

</body>
</html> [/I]

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

to post a comment
JavaScript

10 Comments(s)

Copy linkTweet thisAlerts:
@pyroAug 12.2003 — You might want to take a look at http://www.alistapart.com/issues/126/
Copy linkTweet thisAlerts:
@chadypuauthorAug 12.2003 — i already looked at that

all i want is someone to get me in the right direction with these cookies
Copy linkTweet thisAlerts:
@pyroAug 12.2003 — I haven't personally read through this, but perhaps it will help you: http://www.webreference.com/js/column8/
Copy linkTweet thisAlerts:
@chadypuauthorAug 12.2003 — ill read that but i would like someone just to show me, IMO tutorials suck
Copy linkTweet thisAlerts:
@pyroAug 12.2003 — 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
Copy linkTweet thisAlerts:
@chadypuauthorAug 12.2003 — ill read that too

thanks
Copy linkTweet thisAlerts:
@pyroAug 12.2003 — You're welcome... ?
Copy linkTweet thisAlerts:
@chadypuauthorAug 12.2003 — you seem to be everywhere tonight :p
Copy linkTweet thisAlerts:
@pyroAug 12.2003 — lol... I find hanging out on here relaxing... ?
Copy linkTweet thisAlerts:
@chadypuauthorAug 12.2003 — 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
×

Success!

Help @chadypu spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...