Fundamentals of Front End Development MCQs with Answers
Practice important Fundamentals of Front End Development MCQs with answers and explanations.
Chapter: 95
Q1061:
Fill in the blank: The responseText property returns the server response as a ______.
A. string
B. XML object
C. JSON object
D. number
Correct Answer:
A
Chapter: 95
Q1062:
How do you access an XML object in the response of an AJAX request?
A. Use responseText
B. Use responseXML
C. Use getElementsByTagName
D. Use getElementById
Correct Answer:
B
Chapter: 95
Q1063:
What method is used to parse XML from the server response?
A. responseText
B. responseXML
C. parseXML
D. xmlParse
Correct Answer:
B
Chapter: 95
Q1064:
Fill in the blank: In the callback function, xhttp.readyState == 4 indicates that the request has ______.
A. been initialized
B. been received
C. been processed
D. completed and response is ready
Correct Answer:
D
Chapter: 95
Q1065:
What property of XMLHttpRequest is used to handle the server response when the response is XML?
A. responseText
B. responseXML
C. responseData
D. responseObject
Correct Answer:
B
Chapter: 95
Q1066:
Fill in the blank: To get the value of an XML element named "BookTitle", use getElementsByTagName("BookTitle") and access it using the ______ property.
A. nodeValue
B. innerHTML
C. textContent
D. value
Correct Answer:
A
Chapter: 95
Q1067:
What should you do if the server response is not in XML format?
A. Use responseXML
B. Use responseText
C. Convert it to XML
D. Ignore it
Correct Answer:
B
Chapter: 95
Q1068:
How would you modify the myFunc function to handle different AJAX responses?
A. Pass a different URL and callback function for each AJAX task
B. Create a new XMLHttpRequest object for each task
C. Use responseText for all tasks
D. Ignore the callback function
Correct Answer:
A
Chapter: 95
Q1069:
Fill in the blank: The xhttp.onreadystatechange function is called when the ______ property of XMLHttpRequest changes.
A. status
B. responseText
C. readyState
D. responseXML
Correct Answer:
C
Chapter: 95
Q1070:
What does the xhttp.onreadystatechange function check to ensure the request was successful?
A. xhttp.readyState == 3 && xhttp.status == 400
B. xhttp.readyState == 2 && xhttp.status == 500
C. xhttp.readyState == 4 && xhttp.status == 200
D. xhttp.readyState == 1 && xhttp.status == 404
Correct Answer:
C
Chapter: 95
Q1071:
Fill in the blank: If the server response contains XML data, you can parse it using xhttp.responseXML and retrieve the data with ______.
A. getElementsByTagName
B. innerHTML
C. parseXML
D. responseText
Correct Answer:
A
Chapter: 96
Q1072:
What is jQuery?
A. A type of HTML tag
B. A fast, small, and feature-rich JavaScript library
C. A CSS framework
D. A JavaScript function
Correct Answer:
B
Chapter: 96
Q1073:
Which of the following is a feature of jQuery?
A. HTML/DOM manipulation
B. JavaScript syntax highlighting
C. Python scripting
D. SQL database management
Correct Answer:
A
Chapter: 96
Q1074:
How can you include jQuery in an HTML document?
A. By downloading the library and including it via <script> tag
B. By including it in a CSS file
C. By using an XML file
D. By importing a Java class
Correct Answer:
A
Chapter: 96
Q1075:
The jQuery library can be included from a ______.
A. CDN
B. JSON
C. SQL
D. XML
Correct Answer:
A
Chapter: 96
Q1076:
What is the purpose of the minified version of jQuery?
A. For testing and development
B. For production environments
C. For adding animations
D. For HTML manipulation
Correct Answer:
B
Chapter: 96
Q1077:
Which CDN hosts jQuery?
A. Google and Microsoft
B. Yahoo and Amazon
C. Facebook and Twitter
D. IBM and Oracle
Correct Answer:
A
Chapter: 96
Q1078:
To add jQuery to an HTML document using a CDN, you use the <script> tag with a ______.
A. URL
B. Java class
C. CSS file
D. SQL query
Correct Answer:
A
Chapter: 96
Q1079:
Which version of jQuery is best suited for production environments?
A. Development version
B. Minified version
C. Uncompressed version
D. Raw JavaScript version
Correct Answer:
B
Chapter: 97
Q1080:
What does the $ sign represent in jQuery?
A. A variable
B. A selector
C. A function
D. A jQuery object
Correct Answer:
D