Web page using AJAX and PHP PDF

Title Web page using AJAX and PHP
Author Prashant Saini
Course Web Design &Applications
Institution University of Mumbai
Pages 3
File Size 145.7 KB
File Type PDF
Total Downloads 77
Total Views 197

Summary

Theory: AJAX stands for Asynchronous JavaScript and XML. It’s a new technique for creating better, faster, and more interactive web applications with the help of XML, HTML, CSS, and Java Script. Ajax uses XHTML for content, CSS for presentation, along with Document Object Model and JavaScript for dy...


Description

Experiment No - 8 Aim: Implement a web page using AJAX and PHP. Theory: AJAX stands for Asynchronous JavaScript and XML. It’s a new technique for creating better, faster, and more interactive web applications with the help of XML, HTML, CSS, and Java Script. Ajax uses XHTML for content, CSS for presentation, along with Document Object Model and JavaScript for dynamic content display. Conventional web applications transmit information to and from the sever using synchronous requests. It means you fill out a form, hit submit, and get directed to a new page with new information from the server. With AJAX, when you hit submit, JavaScript will make a request to the server, interpret the results, and update the current screen. In the purest sense, the user would never know that anything was even transmitted to the server. XML is commonly used as the format for receiving server data, although plain text format can also be used. AJAX just uses a combination of:  

A browser built-in XMLHttpRequest object (to request data from a web server) JavaScript and HTML DOM (to display or use the data)

Fig. 8.1 Working of Ajax

      

1. An event occurs in a web page (the page is loaded, a button is clicked) 2. An XMLHttpRequest object is created by JavaScript 3. The XMLHttpRequest object sends a request to a web server 4. The server processes the request 5. The server sends a response back to the web page 6. The response is read by JavaScript 7. Proper action (like page update) is performed by JavaScript



Example: In the example below, when a user types a character in the input field, a function called "showHint()" is executed.



The function is triggered by the onkeyup event.



Start typing a name in the input field below:

First name:

Suggestions:

The PHP file: “gethint.php” un example »

Result: A web page is designed using AJAX and PHP script....


Similar Free PDFs