It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Board index Programming JavaScript Forum

Javascript wishlist

Javascript wishlist

Postby Lexxi on Sat Apr 21, 2007 7:50 pm

I'm lost on spliting and looping to get results out of a cookie. Please help!

my cookie is:

cookieString = 'photo1:Think Pink Calculator - Pink=link1&' + 'photo2:This is photograph two=link2&' + 'photo3:This is photograph three=link3&' + 'photo4:This is photograph four=link4'

function setCookie(name, value) {
document.cookie = name + "=" + escape(value);
}

setCookie('photos', cookieString);

What I am trying to do is split this cookie into the four sections (one for each photo), and then each section into three: the photograph, the name, and the link (where photo1 is photo1.jpg, the text remains text, and the link1 is link1.htm) only I don't know how to do it. I have my images and links stored in arrays, and I know I have to split the cookie 4 times, but I can't get them to split the way I want them to so that I can display like this:

Image

Can some one help?
Lexxi
 
Posts: 3
Joined: Sat Apr 21, 2007 7:44 pm

Postby Lexxi on Tue Apr 24, 2007 9:55 am

PLEASE HELP

The following cookie is formed by clicking my add to wishlist buttons:

cookieString =
'photo1:This is photograph one=link1&' +
'photo2:This is photograph two=link2&' +
'photo3:This is photograph three=link3&' +
'photo4:This is photograph four=link4'

I need to know how to produce this:

Image

where photo1 is a jpg file, and link1 is an htm file.

I have only been working with javascript for 2 months so I am a real noob and need serious help.
Lexxi
 
Posts: 3
Joined: Sat Apr 21, 2007 7:44 pm


Who is online

Users browsing this forum: No registered users and 8 guests