Re: Variable life



"Joshie Surber" <joshiesurber@xxxxxxxxx> wrote:


joe wrote:
I am developing shopping cart page. The shopping basket consists of several html
pages (there are hundreds of products).

When a user click the "Add to basket" button my javascript adds items to an array
variable.

When he want to browse other html shopping basket pages he clicks a page HREF
link on my page. How do I pass my array variable to the new page? I'm sure there
is some way or different approach.

I am new to javescript so apologies if this is a trivial matter.

Don't even try it. If someone has a browser that doesn't support JS, or
they have turned it off (nearly 15% of net users!) you have just lost a
sale.

If you insist, you can have your add2cart funtion update everything in
document.links and append your cart info to the URL.

But don't do it.

What do you suggest instead of Javascript?
.


Quantcast