Shopping cart coding - Client or server side?
-
Is it acceptable - with the ubiquity of modern browser usage - to code a website's shopping cart in Js as opposed the aite's framework language (php, ASP, etc)? What are the cons of going that route?
-
Answer:
Depends on requirements. Your answer spans a range of possibilities from, at one extreme, a client based shopping with no persistence at all, to a cart which uses sessions to persist, to a cart which persists explicitly in your own database (implying an account system). All of these could be implemented either in JavaScript/AJAX or traditionally using form submits and page requests. It really comes down to the kind of user experience you want to offer. AJAX can give you a more streamlined flow without page reloads. A key point of course is whether you need to support browsers with JavaScript disabled, or blocked. If so, you can fall back to a non-JS version of the flow.
Toby Thain at Quora Visit the source
Other answers
The main con is simple - if the input to the site is incorrect, and you arenât checking it both in the browser and the server, youâre getting bad input. That can lead to SQL injection, a blown server or any other of many problems.Some things should be done in the client (checking the length of phone numbers and zip codes, formatting phone numbers, Capitalizing the first letters of names, etc.) and some things have to be done on the server (checking things in a server-side database. (Even using AJAX to get the data to the browser means getting it from the server first.)So the answer to your question - âShopping cart coding - client or server?â is âbothâ. Some parts have to be on one or the other, some parts should be on one or the other and some parts should be on both. (Never send unchecked data to the server, never let the server accept data without checking it - even if it was checked in the client.)And thatâs only one example of the simplest problem with putting code on only one or the other.
Al Klein
Related Q & A:
- Do you know of a software similar to coffeecup shopping cart?Best solution by Yahoo! Answers
- How cookies are handled if you use a proxy between a client and server in HTTP?Best solution by Stack Overflow
- How can I add the data to shopping cart?Best solution by Stack Overflow
- How can I get the remote server's date and time at the client side in my application in c#?Best solution by Stack Overflow
- How to Use my shopping cart and store with my Affiliate program?Best solution by Yahoo! Answers
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.