Wushu
12-07-2005, 01:51 AM
Hiya, ive stored lots of dvd titles in document.cookie and they are displaying as
"dvds=%3AIndiana%20Jones%20Box%20Set%203AStar%20Wars%20Episode%20III"
I have two pages, a buy page and a cart page. In the cart page it transfers all the data of document.cookie into an array and spits it out to display. Im able to delete the titles from cookiearray which holds the dvds on the cart page but document.cookie is still holding those titles so each time i go to the page it rebuilds the old cart.
Ive been trying to implement this piece of code but i can seem to work it out, the spaces are giving me problems. - this is part of an onclick function which removes items from the cart. I can do it with the array no problem i just cant seem to work out how to do it with document.cookie, this method works when this are no spaces involved.
str = cookiearray[counter+1]
document.cookie = document.cookie.replace(':' + str, "");
Any ideas?
"dvds=%3AIndiana%20Jones%20Box%20Set%203AStar%20Wars%20Episode%20III"
I have two pages, a buy page and a cart page. In the cart page it transfers all the data of document.cookie into an array and spits it out to display. Im able to delete the titles from cookiearray which holds the dvds on the cart page but document.cookie is still holding those titles so each time i go to the page it rebuilds the old cart.
Ive been trying to implement this piece of code but i can seem to work it out, the spaces are giving me problems. - this is part of an onclick function which removes items from the cart. I can do it with the array no problem i just cant seem to work out how to do it with document.cookie, this method works when this are no spaces involved.
str = cookiearray[counter+1]
document.cookie = document.cookie.replace(':' + str, "");
Any ideas?