PDA

View Full Version : cookies


Kevin
03-16-2003, 09:14 PM
Hi:

Can you take a look at these cookie functions and tell me if I'm in the right neighborhood?
All I'm attempting to do at this time is simply save the data and read it into an alert box.
insight always appreciated

Thank You
Kevin


function SaveColors() {
var mybgColor = document.bgColor;
var myCookie = "BG_Color=" + escape(mybgColor)
document.cookie = myCookie;
}

function ReadCookie() {
var CIS89Cookie = document.cookie
// split into an Array - left of = into brokenCookie[0]
// right of = into brokenCookie[1]
var brokenCookie = CIS89Cookie.split("=")
var color = brokenCookie[0] // only one piece of info
color = unescape(color)
alert(color)
}