31 Questions
What is AJAX?
A technique for creating fast and dynamic web pages
Which object is used to create an XMLHttpRequest in modern browsers?
XMLHTTP
What method is used to send a request to a server using XMLHttpRequest?
send()
What does the responseText property of XMLHttpRequest contain?
The server's response as a string
Which applications use AJAX according to the given text?
Google Search, Google Maps, Gmail
What happens if a classic web page (not using AJAX) needs to change its content?
The whole page is reloaded
What triggers the onreadystatechange event handler?
Every time the readyState property changes
When is the response considered ready?
When readyState is 4 and status is 200
What happens if the input field in the AJAX and PHP Example is empty?
The content of txtHint is cleared and the function exits
What does the xmlhttp.send() method do?
Sends the request off to a file on the server
What happens when str.length == 0 in the showHint() function?
The content of txtHint is cleared and the function exits
What parameter is added to the URL in the showHint() function?
(q)
How many times is onreadystatechange triggered?
Four times, once for each change in readyState
xmlhttp.onreadystatechange
is designed to be a function that will be called:
Every time the readyState property changes in XMLHttpRequest
showHint()
function executes what operations when the input field is not empty?
Create an XMLHttpRequest object
, Create a function to be executed when the server response is ready
, Send the request off to a file on the server
What does 'this.readyState == 4 && this.status == 200' represent?
Condition for checking if response is ready
What is the purpose of AJAX in web development?
To update parts of a web page without reloading the whole page
Which object is used to create an XMLHttpRequest in modern browsers?
XMLHttpRequest object
What does the 'xmlhttp.onreadystatechange' event handler represent?
The function that will be called when readyState changes
What happens if the input field in the AJAX and PHP Example is empty?
No request is sent to the server
What is the responseText property of XMLHttpRequest used for?
To store the response from the server as a text string
When should old versions of Internet Explorer (IE5 and IE6) use an ActiveX Object to create an XMLHttpRequest?
Old versions of Internet Explorer should never use an ActiveX Object
What is the purpose of the onreadystatechange event handler in the context of XMLHttpRequest?
To define a function that is called when the readyState property changes
What does 'this.readyState == 4 && this.status == 200' represent in the context of XMLHttpRequest?
A check for successful server response readiness
What happens when str.length == 0 in the showHint() function?
The content of the txtHint placeholder is cleared
In the context of AJAX and PHP Example, what does the showHint() function do when the input field is not empty?
Adds a parameter to the URL and sends a request to a file on the server
What triggers the onreadystatechange event handler in the context of XMLHttpRequest?
Changes in readyState property of the XMLHttpRequest
What does the xmlhttp.send() method do in the context of XMLHttpRequest?
Sends a request to the server
What are three important properties of the XMLHttpRequest object that determine if the response is ready?
'readyState', 'status', 'responseText'
When is the response considered ready in the context of XMLHttpRequest?
When readyState is 4 and status is 200
What happens if a classic web page (not using AJAX) needs to change its content?
It reloads the entire page to change its content
Test your knowledge on PHP advanced concepts and AJAX for web development. Understand the concepts and techniques for creating fast and dynamic web pages using AJAX to update parts of a web page without reloading the whole page.
Make Your Own Quizzes and Flashcards
Convert your notes into interactive study material.
Get started for free