In this section we will create a simple Ajax Application for displaying the current date and time. Date and time information are retrieved asynchronously from the server side php script. Our HTML page calls serverside php script to retrieve the today's date. Once the time data is retrieved from the server, it uses javascript and css to display the time on the HTML page.
Here is the code of HTML File:
Ajax Example
This very simple Ajax Example retrieves the
current date and time from server and shows on the form. To view the current
date and time click on the following button.
When use clicks on the "Show Time" button, the showCurrentTime() is called. The the function showCurrentTime() calls the time.php using Ajax and then updates the time values retrieved from server.
0 comments:
Post a Comment