Lets see how to use Ajax with jQuery:
For this we are using two jsp pages. One page which contains the ajax call to the other and displays the content without refreshing the page.
Our first page is Ajax.jsp which depicts Shooping books Online applciation. In this page, the user is asked to enter the value in the image and press tab to see the list of books available for shopping online. If the user enters mismatching words , he will get an error message.
1. Load the jquery.js file
2. Add a textbox to enter the characters and a paragraph area for the items to be displayed
3. Add the jquery function which does an ajax call to names.jsp and fetches the data. If the user enter the right credentials, fetched data will be displayed.
4. Output screens