Noob to javascript
minis_r_me
Status: New User - Welcome
Joined: 16 Jun 2008
Posts: 1
Reply Quote
i have read the tutorial about javascript cookies but was unsure what to do.

i have found this code to swap the backgrouns and text colours:

:: Code ::
function ChangeColor(Color) {
alert(Color);
if (Color == 'Blue') {
   document.getElementById("body").style.background="#000099 url(images/blue/bg.png) repeat-x";
   document.getElementById("body").style.color="#fff";
}
if (Color == 'Red') {
   document.getElementById("body").style.background="#B90000 url(images/red/bg.png) repeat-x";
   document.getElementById("body").style.color="#fff";
}
if (Color == 'Green') {
   document.getElementById("body").style.background="#004000 url(images/green/bg.png) repeat-x";
   document.getElementById("body").style.color="#fff";
}
}


how would i go about adding the cookie feature.

cheers
carl
Back to top
jeffd
Status: Assistant
Joined: 04 Oct 2003
Posts: 594
Reply Quote
Sorry, it's too hard to walk someone through all the learning steps they need to do themselves, my advice is to start reading, practicing, begin with very simple things like how to write a simple function, how to call that function on the page, and so on.

While it's possible someone can walk you through your specific issue, well, let's rephrase that, that someone would write all your code for you to do this specific thing you want to try, it wouldn't do you any good until you learn a bit more.

I recommend reading, practicing, and so on.

This forum doesn't really cater to serious noobs, it's just too time consuming to do that, but good luck in general.
Back to top
Display posts from previous:   

All times are GMT - 8 Hours