ADVERTISEMENT
ADVERTISEMENT

AJAX Multiple-Choice Questions (MCQs)

Ajax is a set of web development techniques that uses various web technologies (XML, HTML, CSS, and JavaScript) on the client-side to create asynchronous web applications. With Ajax, web applications can send and retrieve data from a server asynchronously without interfering with the display and behavior of the existing page.

Ajax MCQs: This section contains Ajax Multiple-Choice Questions with Answers. These Ajax MCQs are written for beginners as well as advanced, practice these MCQs to enhance and test the knowledge of Ajax.

List of Ajax MCQs

1. Ajax is used for creating _____.

  1. Web applications
  2. Desktop applications
  3. System applications
  4. Both A. and B.

Answer: A) Web applications

Explanation:

Ajax is used for creating better, faster, and more interactive web applications with the help of XML, HTML, CSS, and JavaScript.


2. Ajax stands for ______.

  1. Asynchronous JavaScript and XML
  2. Asynchronous JSON and XML
  3. Asynchronous Java and XML
  4. Asynchronous JavaScript and XMLHttpRequest

Answer: A) Asynchronous JavaScript and XML

Explanation:

AJAX stands for Asynchronous JavaScript and XML.


3. Which are the two major features of AJAX?

  1. Make requests to the server without reloading the page
  2. Receive and work with data from the server
  3. Make requests to the server with reloading the page
  4. Only receive the data from the server

Answer: A & B

Explanation:

The two major features of AJAX are:

  • Make requests to the server without reloading the page
  • Receive and work with data from the server

4. What server support Ajax?

  1. WWW
  2. SMTP
  3. HTTP
  4. All of the above

Answer: C) HTTP

Explanation:

HTTP server support Ajax.


5. Which of the following feature makes the Ajax unique?

  1. It can work with all the databases
  2. It is a server-side application can also be used to create servers
  3. It can use Python & C++ for programming
  4. It makes data requests asynchronously

Answer: D) It makes data requests asynchronously

Explanation:

Ajax makes data requests asynchronously – it's a feature that makes the Ajax unique.


6. Ajax sends data to a web server _____.

  1. in the background
  2. before loading the page
  3. with reloading the page
  4. All of the above

Answer: A) in the background

Explanation:

Ajax sends data to a web server in the background.


7. Ajax updates a web page ____ reloading the page.

  1. with
  2. without

Answer: B) without

Explanation:

Ajax updates a web page without reloading the page


8. How many types of triggers are present in update panel?

  1. one
  2. two
  3. three
  4. four

Answer: B) two

Explanation:

There are two types of triggers are present in update panel.


9. Which are the triggers present in update panel?

  1. PostTrigger and AsyncPostTrigger
  2. PostBackTrigger and SyncPostBackTrigger
  3. SyncPostBackTrigger and AsyncPostBackTrigger
  4. PostBackTrigger and AsyncPostBackTrigger

Answer: D) PostBackTrigger and AsyncPostBackTrigger

Explanation:

There are two types of triggers present in update panel, which are:

  • PostBackTrigger
  • AsyncPostBackTrigger

10. Why PostBackTrigger is used in update panel?

  1. Specifies a control and event that will cause a full-page update
  2. Specifies a control and event that will cause a partial page update
  3. Specifies a control and event that will cause a full web application update
  4. Specifies a control and event that will cause a full web application refresh

Answer: A) Specifies a control and event that will cause a full-page update

Explanation:

The PostBackTrigger trigger is used for specifying a control and event that will cause a full-page update.


11. Why AsyncPostBackTrigger is used in update panel?

  1. Specifies a control and event that will cause a full-page update
  2. Specifies a control and event that will cause a partial page update
  3. Specifies a control and event that will cause a full web application update
  4. Specifies a control and event that will cause a full web application refresh

Answer: B) Specifies a control and event that will cause a partial page update

Explanation:

The AsyncPostBackTrigger trigger is used for specifying a control and event that will cause a partial page update.


12. Which formats are supported by Ajax to send and receive information?

  1. JSON, XML, HTML, SQL, MySQL, and Text Files
  2. JSON, XML, HTML, and Text Files
  3. JSON, XML, HTML, NoSQL, and Oracle
  4. JAVA, JSON, XML, HTML, Oracle, and Text Files

Answer: B) JSON, XML, HTML, and Text Files

Explanation:

Ajax can send and receive information in various formats, including JSON, XML, HTML, and text files.


13. Ajax technologies include ______.

  1. HTML/XHTML and CSS
  2. DOM
  3. XML or JSON
  4. XMLHttpRequest
  5. JavaScript
  6. All of the above

Answer: F) All of the above

Explanation:

Ajax technologies include the following technologies:

  • HTML/XHTML and CSS
  • DOM
  • XML or JSON
  • XMLHttpRequest
  • JavaScript

14. Which technologies give Ajax its name?

  1. Net and XML
  2. ASP and XML
  3. Asynchronous JavaScript, CSS, ASP, and XML
  4. Asynchronous JavaScript and XML

Answer: D) Asynchronous JavaScript and XML

Explanation:

The combination of Asynchronous JavaScript and XML give Ajax its name.


15. Which company made Ajax popular?

  1. Oracle
  2. Google
  3. Microsoft
  4. Facebook

Answer: B) Google

Explanation:

AJAX was made popular in 2005 by Google, with Google Suggest.


16. Ajax is about updating ______, without reloading the full-page.

  1. parts of a web page
  2. parts of a database records
  3. parts of a HTML tags dynamically
  4. parts of a CSS classes dynamically

Answer: A) parts of a web page

Explanation:

Ajax is about updating parts of a web page, without reloading the full-page.


17. What are the advantages of Ajax?

  1. Bandwidth utilization
  2. More interactive
  3. Speeder retrieval of data
  4. All of the above

Answer: D) All of the above

Explanation:

The advantages of Ajax are:

  • Bandwidth utilization
  • More interactive
  • Speeder retrieval of data

18. What is update panel in Ajax?

  1. a server control used to update the specified portion of a web page
  2. server control used to update the full-page after reloading the page
  3. a dashboard used to update the specified portion of a web page
  4. None of the above

Answer: C) a dashboard used to update the specified portion of a web page

Explanation:

In the Ajax – Update panel is a server control used to update the specified portion of a web page.


19. Which object can be used to exchange data with a server behind the scenes?

  1. XMLHttpRequest
  2. HttpsRequest
  3. JSONHttpRequest
  4. All of the above

Answer: A) XMLHttpRequest

Explanation:

The XMLHttpRequest object can be used to exchange data with a server behind the scenes.


20. What is the correct syntax to create an XMLHttpRequest object?

  1. XMLHttpRequest() variable
  2. XMLHttpRequest() variable;
  3. variable = new XMLHttpRequest()
  4. variable = new XMLHttpRequest();

Answer: D) variable = new XMLHttpRequest();

Explanation:

The correct syntax to create an XMLHttpRequest object is:

variable = new XMLHttpRequest();

21. Which method cancels the current request?

  1. cancel()
  2. abort()
  3. stop()
  4. pause()

Answer: B) abort()

Explanation:

The abort() method is used to cancel the current request.


22. Which method returns the header information?

  1. getAllResponseHeaders()
  2. getResponseHeaders()
  3. getHeaderInformation()
  4. getAllHeaderInformations()

Answer: A) getAllResponseHeaders()

Explanation:

The getAllResponseHeaders() method is used to get the header information.


23. Which method returns the specific header information?

  1. getResponseHeader()
  2. getSpecifcHeader()
  3. getHeaderOnly()
  4. getHeaderInfo()

Answer: A) getResponseHeader()

Explanation:

The getResponseHeader() method is used to get the specific header information.


24. Which method adds a label/value pair to the header to be sent?

  1. getRequestHeader()
  2. setAllRequestHeader()
  3. setRequestHeader()
  4. getAllRequestHeader()

Answer: C) setRequestHeader()

Explanation:

The setRequestHeader() method is used to add a label/value pair to the header to be sent.


25. Which property holds the status of the XMLHttpRequest?

  1. readyState
  2. holdState
  3. pauseState
  4. stopState

Answer: A) readyState

Explanation:

The readyState property is used to holds the status of the XMLHttpRequest.


26. Which property returns the response data as a string?

  1. getText
  2. getResponseText
  3. responseText
  4. responseAllText

Answer: C) responseText

Explanation:

The responseText property returns the response data as a string.


27. Which property returns the response data as XML data?

  1. getXML
  2. getResponseXML
  3. responseXML
  4. responseAllXML

Answer: C) responseXML

Explanation:

The responseXML property returns the response data as XML data.


28. Which property returns the status-number of a request?

  1. statusText
  2. statusXML
  3. status-number
  4. status

Answer: D) status

Explanation:

The status property returns the status-number of a request.


29. Which property returns the status-text?

  1. statusText
  2. statusXML
  3. status-number
  4. status

Answer: A) statusText

Explanation:

The statusText property returns the status-text.


30. "GET is simpler and faster than POST." – Is this statement true?

  1. Yes
  2. No

Answer: A) Yes

Explanation:

Yes, the statement "GET is simpler and faster than POST." is true.


31. Which is the correct syntax to add HTTP headers to the request?

  1. setRequestHeader(value, header)
  2. setAllRequestHeader(value, header)
  3. setRequestHeader(header, value)
  4. setAllRequestHeader(header, value)

Answer: C) setRequestHeader(header, value)

Explanation:

The correct syntax to add HTTP headers to the request is,

setRequestHeader(header, value)

32. How to convert the below statement to the synchronous request?

xhttp.open("GET", "info.php", true);
  1. Convert the third parameter to "false"
  2. Convert the third parameter to "sync"
  3. Convert the first parameter to "sync_GET"
  4. All of the above

Answer: A) Convert the third parameter to "false"

Explanation:

To execute a synchronous request, you need to change the third parameter of the open() method to false.


33. Which are the two properties to hold the status of XMLHttpRequest?

  1. status and statusText
  2. statusNum and statusText
  3. statusId and statusText
  4. None of the above

Answer: A) status and statusText

Explanation:

The status and statusText properties are used to hold the status of the XMLHttpRequest object.


34. If the value of status property is 404, what does it mean?

  1. OK
  2. Forbidden
  3. Method Not Allowed
  4. Page not found

Answer: D) Page not found

Explanation:

Value 404 represents "Page not found".


35. The ______ function is called every time the readyState changes.

  1. getreadystatechange
  2. onreadystatechange
  3. onsetreadystatechange
  4. toreadystatechange

Answer: B) onreadystatechange

Explanation:

The onreadystatechange function is called every time the readyState changes.



ADVERTISEMENT
ADVERTISEMENT


Comments and Discussions!



ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT

Languages: » C » C++ » C++ STL » Java » Data Structure » C#.Net » Android » Kotlin » SQL
Web Technologies: » PHP » Python » JavaScript » CSS » Ajax » Node.js » Web programming/HTML
Solved programs: » C » C++ » DS » Java » C#
Aptitude que. & ans.: » C » C++ » Java » DBMS
Interview que. & ans.: » C » Embedded C » Java » SEO » HR
CS Subjects: » CS Basics » O.S. » Networks » DBMS » Embedded Systems » Cloud Computing
» Machine learning » CS Organizations » Linux » DOS
More: » Articles » Puzzles » News/Updates

© https://www.includehelp.com some rights reserved.