Practical Uses - Java Script

Although all this client-server communication stuff is really cool,it also has some practical applications. You can,for example, create a search page that never unloads.It simply makes a request to get new data for each new search you submit.

After your first A9 search, you can choose to add images, movies, books, and other information to your search results by clicking on the various options on the right of the screen. As you do, a new area in the page opens up, and new search results are loaded using the hidden iframe technique discussed earlier.

Several Web sites use JavaScript client-server communication to provide search results. One such site,the Bitflux blog (http://blog.bitflux.ch/), uses a XML HTTP request objects for its LiveSearch capability.This cool technique uses the onkeypress event handler to detect what the user types into the search box. For each new letter entered into the text box, the site does a search and displays its results in a layer directly on the page, without ever reloading the page.

Another good use for this type of communication is to provide functionality that isn’t available in JavaScript.For instance,you may want to validate some data the user has entered against a database.Using the onblur event handler, you can make a request back to the database to determine if the value is valid, and then present an error message to the user if is the data is not valid. The possibilities really are endless.


All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

Java Script Topics