Re: Variable life
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.javascript archive

Re: Variable life

From: Joshie Surber <joshiesurber@gmail.com>
Date: Sat Apr 29 2006 - 06:45:16 CEST

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.
Received on Mon May 1 05:26:35 2006