问题
I am looking to implement something that appears to have "shopping cart" functionality, but is completely on the client-side. I can do this using jQuery and cookies (and I event found this Smart Cart 2 plugin for helping with a large part of it), but before I build it - Does anyone know of an existing solution that is completely client-side, and uses javascript (preferrably jQuery) and cookies?
Also, other than the small percentage of users whose browsers don't support javascript and/or cookies, does anyone see a major problem with this approach?
回答1:
simpleCart(js) works quite nicely for light-weight, client-side shopping carts. Obviously manually fill orders to make sure correct funds are deposited for each order.
回答2:
I see security issues with this. Putting something completely on the client-side and then storing it in cookies basically means you are giving complete control of the process to the user. They can edit every single part of the transaction. They can map your jquery ajax calls, etc, and edit them, or even play them out of order.
For example,
instead of 1) put item in cart 2) subtotal 3)charge 4)checkout they could call 1) subtotal 2) charge 3) item in cart 4) checkout.
In any event, anything you implement I'd probably take a good look at to see the security features implemented.
来源:https://stackoverflow.com/questions/5399600/open-source-client-side-shopping-cart-jquery-cookies