Web Services Development MCQs with Answers
Practice important Web Services Development MCQs with answers and explanations.
Multiple Choice Questions
Q351: What is the correct syntax to create a new XMLHttpRequest object?
- A: var xhttp = new XMLHttpRequest();
- B: xhttp.createXML();
- C: xhttp.XMLHttpRequest();
- D: newRequest();
View Answer
A
Q352: Which nodeType value corresponds to an element node?
- A: 2
- B: 1
- C: 3
- D: 9
View Answer
B
Q353: Which method is used to return all elements with a specified tag name in an XML document?
- A: getElementById
- B: getAttribute
- C: getElementsByTagName
- D: getNodeByName
View Answer
C
Q354: How can you access the third <title> element in an XML document?
- A: x = xmlDoc.getElementsByTagName("title")[2];
- B: x = xmlDoc.getElementsByTagName("title")[3];
- C: x = xmlDoc.getTitleElement();
- D: x = getElementsByNodeName("title",2);
View Answer
A
Q355: What does the nodeValue property of a text node return?
- A: Node name
- B: Attribute name
- C: Text itself
- D: XML document
View Answer
C
Q356: In the DOM, what is the nodeName of the document node?
- A: #document
- B: root
- C: xml
- D: #root
View Answer
A
Q357: What does the method send() do in XMLHttpRequest?
- A: Receive data
- B: Sends a request to the server
- C: Send a file to the server
- D: Load XML document
View Answer
B
Q358: What does the nodeType property represent for a comment node?
- A: 1
- B: 2
- C: 8
- D: 9
View Answer
C
Q359: In which case should POST be used over GET?
- A: When the file is cached
- B: When sending small data
- C: When sending user input
- D: When file is read-only
View Answer
C
Q360: Which method creates a new XMLHttpRequest object?
- A: xmlhttp.create()
- B: new XMLObject()
- C: new XMLHttpRequest()
- D: xml.openRequest()
View Answer
C