AJAX – How to Handle Frequent AJAX Requests in Shopping Cart

ajaxdesign

Is it common and/or acceptable to have Ajax requests every time a button is clicked on a shopping cart page? This is not a high traffic site. It will only have a few users at a time, like 5 max. I'm calling it a shopping cart for lack of a better term. The site is intended to let customers create highly customized orders, which benefits from logic being on the server instead of on the client.

I have many questions regarding the best practices in this sort of design. Like, should I block user input until the ajax request is received? Should I be sure to display an error message if the ajax request fails? Should I automatically repeat the ajax request if it fails? Are there any other considerations?

Best Answer

It looks like you are interested in best practices to follow or just use in your case. There are a number of written article on this subject matter, however there are few good once that combine techniques in one as well :)

Regarding your questions, i would skip the one saying "Should I automatically repeat the Ajax request if it fails?" - No, just process the failure message in user friendly way.

More readings on best practices with Ajax calls:

Related Topic