Putting it all togethar - AJAX

Listing shows the complete client-side code for our Ajax application.

The Complete Ajax Application

Loading the page into our browser, we can see that the server time is displayed in the <div> container, indicating that the onLoad event handler for the <body> of the page has fired when the page has loaded.

User Feedback
Note also that we have provided user feedback via the line

which executes on each change to the value readyState until the condition

is satisfied.This line loads into the time display element an animated GIF with a rotating pattern, indicating that a server request is in progress, as shown in Figure

An animated image provides user feedback

An animated image provides user feedback

Now, each time we click on the Get Server Time button, the time display is updated. Figure shows the completed application.

Our Completed Ajax application

Our Completed Ajax application

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

AJAX Topics