517). Which property helps to initiate the HTTP requests?
[A]request
[B]location
[C]send
[D]write
Show Answer
Correct Answer: location
Notes:
Answer: b
Explanation: It is possible for JavaScript code to script HTTP, however. HTTP requests are initiated when a script sets the location property of a window object or calls the submit() method of a form object. The location object is part of the window object and is accessed through the window.location property.
518). Which method is an alternative of the property location of a window object?
[A]submit()
[B]locate()
[C]load()
[D]write()
Show Answer
Correct Answer: submit()
Notes:
Answer: a
Explanation: HTTP requests are initiated when a script sets the location property of a window object or calls the submit() method of a form object. In both cases, the browser loads a new page.
519). Which of the following uses scripted HTTP?
[A]XML
[B]HTML
[C]Ajax
[D]CSS
Show Answer
Correct Answer: Ajax
Notes:
Answer: c
Explanation: AJAX stands for Asynchronous JavaScript And XML. The key feature of an Ajax application is that it uses scripted HTTP to initiate data exchange with a web server without causing pages to reload.
520). Which of the below is a liberal reverse of Ajax?
[A]HTTP
[B]HTML
[C]XML
[D]Comet
Show Answer
Correct Answer: Comet
Notes:
Answer: d
Explanation: Comet is the reverse of Ajax: in Comet, it is the web server that initiates the communication, asynchronously sending messages to the client. The big advantage of Comet is that each client always has a communication link open to the server.
521). The other name for Comet is _____________
[A]Server Push
[B]Ajax Push
[C] HTTP Streaming
[D]All of the mentioned
Show Answer
Correct Answer: All of the mentioned
Notes:
Answer: d
Explanation: Comet is a web application model where a request is sent to the server and kept alive for a long time, until a time-out or a server event occurs. Other names for Comet include “Server Push”, “Ajax Push”, “HTTP Streaming”.
522). Which is the element that has a src property to initiate HTTP GET request?
[A]img
[B]iframe
[C]script
[D]both img and script
Show Answer
Correct Answer: both img and script
Notes:
Answer: d
Explanation: Both img and script contains the src property that can be set to initiate an HTTP GET request. The src property sets or returns the value of the src attribute of an image.The required src attribute specifies the URL of an image.
523). XMLHttpRequest is a ____________
[A]Object
[B]Class
[C]Both Object and Class
[D]Array
Show Answer
Correct Answer: Both Object and Class
Notes:
Answer: c
Explanation: XMLHttpRequest is both an object and a class. The XMLHttpRequest object can be used to request data from a web server.
524). Which of the following are the features of an HTTP request?
[A]URL being requested
[B]Optional request body
[C] Optional set of request headers
[D]All of the mentioned
Show Answer
Correct Answer: All of the mentioned
Notes:
Answer: d
Explanation: An HTTP request consists of four parts :
the HTTP request method or “verb”
the URL being requested
an optional set of request headers, which may include authentication information
an optional request body
525). Which of the following is a feature of the HTTP response?
[A]Mandatory response body
[B]Optional response body
[C]URL being released
[D]Optional set of response headers
Show Answer
Correct Answer: Mandatory response body
Notes:
Answer: a
Explanation: The HTTP response sent by a server has three parts :
a numeric and textual status code that indicates the success or failure of the request
a set of response headers
the response body
526). Which is the appropriate code to begin a HTTP GET request?
[A]request.open(“GET”,”data”);
[B] request.open(GET,”data.csv”);
[C]request.open(“GET”,”data.csv”);
[D] request.open(“GET”);
Show Answer
Correct Answer: request.open(“GET”,”data.csv”);
Notes:
Answer: c
Explanation: The code that begins a HTTP GET request for the contents of the specified URL is