I have an ecommerce site. I have a global variable named cart
with dynamic value. I would like to keep the value of this variable in other pages and be undfedined
and change it only if the value exist otherwise keep the previous value. How can I make it?
Asked
Active
Viewed 44 times
0

Piggy
- 141
- 1
- 9
-
1I suggest taking a look at javascript cookies or if you're using server side scripting like PHP look into sessions – spaniol6 Oct 13 '15 at 20:00
-
You'll have to send the value over to the server and then return the value in the next request. Or you'll have to store it at client side, through HMTL 5 storage capacities. I would recommend the latter. – Reinard Oct 13 '15 at 20:00