The aim of this task is to give you some (additional) experience at jQuery and Ajax programming.
Study the HTML and jQuery code in this example to see how class attributes and event handlers can dynamically be added to a "clean" HTML document when the document is loaded.
Now consider the simplified user registration document presented here.
Implement the new JavaScript file js/user.js to perform
some client-side input validation. More specifically, write jQuery code to
dynamically add event handlers to add_user.html to
perform the following tests:
find_user.php. This script gets the username from
the variable user, returns the username if it
exists in the database, and returns the empty string otherwise.
For testing, the database initially contains the usernames
"dylan", "heidi", "jolon", "rodney".
Each validation failure should be reported in an alert box (or otherwise).
Do not add JavaScript event handlers (or make other changes) to the HTML document.
Use Ajax to implement a simple shopping cart application. A left panel should display a list of items for sale with their prices (the catalog). A right panel should display the list of items selected by the user, with their prices, and a total price (the shopping cart). The catalog should be stored in a database table on the server. The shopping cart should be stored in another database table. When the user selects an item from the catalog, or removes an item from the shopping cart, an HTTP request should automatically be sent to the server, which should update the shopping cart, and send the updated cart back to the client (as a JSON object), to be displayed by replacing the content of the right panel only.
Complete Task 1 only