AJAX is used to create more interactive applications.
The Below example will demonstrate how a web page can communicate with a web server while a user
type characters in an input field:
Start typing a name in the input field below:
When a user types a character in the input field above, the function "showHint()" is
executed. The function is triggered by the "onkeyup" event:
Source code explanation:
If the input field is empty (str.length==0), the function clears Content of the txtHint
placeholder and exits the function.
If the input field is not empty, the showHint() function executes the following:
The source code in "gethint.html" checks an array of names, and returns the
corresponding name(s) to the browser:
Your Query was successfully sent!