oDesk Test Answers of AJAX Skill Test
Question: 01
What should be called before 'send ()' to prepare an XMLHttpRequest object?

Answer: b. open ()

Question: 02
What is the correct way to execute the function "calc()" when an XMLHttpRequest is loaded?

Answer: a. myRequest.onreadystatechange = calc;

Question: 03
Can AJAX be used with HTTPS (SSL)?

Answer: a. yes

Question: 04
Can you call responseBody or responseText to get a partial result when the readyState of an XMLHttpRequest is 3(receiving)?

Answer: b. No

Question: 05
How can you create an XMLHttpRequest under Internet Explorer 6?

Answer: b.var oReq = new ActiveXObject ("MSXML2.XMLHTTP.3.0");

Question: 06
Consider the following function:

function foo ()
return 5;

What will the following code do?

var myVar = foo;

Answer: b. Assign the pointer to function foo to myVar

Question: 07
Can WebDav methods like PROPFIND be used with XMLHttpRequest.open()?

Answer: a.Yes

Question: 08
Can you start multiple threads with JavaScript?

Answer: b. No

Question: 09
In the following list, which ones are used to fetch the result data of an XMLHttpRequest?

Answer: e. responseXML

Question: 10
Which of the following is not a valid variable name in JavaScript?

Answer: b. 2myVar

Question: 11
Which of the following is a block comment in JavaScript?

Answer: b. /* */

Question: 12
Is it possible to make a page "reload-safe" when using AJAX?

Answer: b. yes, if each AJAX request modifies the server side context, which would render a page similar to the actual JS modified page, if reloaded.

Question: 13
What language does AJAX use on the client side?

Answer: a. JavaScript

Question: 14
Which of the following is not a JavaScript operator?

Answer: e. All of the above are Javascript operators

Question: 15
What is the standardized name of JavaScript?

Answer: c. ECMAScript

Question: 16
Which of the following cannot be resolved by using AJAX?

Answer: d. Server crashes (failover)

Question: 17
It might be needed to set the request content-type to XML explicitly. How can you do so for an XMLHttpRequest Object?

Answer: e. myReq.setRequestHeader ("Content-Type", "text/xml");

Question: 18
You want to update the following element with the XMLHttpRequest status. Which of the following approaches is correct for the purpose?

<div id="statusCode"></div>

Answer: b. var myDiv = document.getElementById ("statusCode");
myDiv.innerHTML = req.status;

Question: 19
What is the correct way to have the function checkState called after 10 seconds?

Answer: b. window.setTimeout(checkState, 10000);

Question: 20
What is true regarding XMLHttpRequest.abort()?

Answer: b.  It will remove the onreadystatechange event handler

Question: 21
Which of the following request types should be used with AJAX?

Answer: d. HTTP POST should be used when the state is updated on the server

Question: 22
When may asynchronous requests be used?

Answer: c.To load additional code from the server

Question: 23
Which of the following are drawbacks of AJAX?

Answer: a.The browser back button cannot be used in most cases

Question: 24
What is NOSCRIPT tag for?

Answer: c. To enclose text to be displayed if the browser doesn't support JS

Question: 25
The server returns data to the client during an AJAX postback. Which of the following is correct about the returned data?

Answer: a. It only contains the data of the page elements that need to be changed

Question: 26
Which of the following list is/are true regarding AJAX?

Answer: c. It can be used to make requests to the server without blocking the user

Question: 27
What is the common way to make a request with XMLHttpRequest?

Answer: d. myReq.send(null);

Question: 28
Which protocol is used to transfer data in an AJAX request?

Answer: b. Hypertext Transfer Protocol, HTTP

Question: 29
What is the syntax for the event listener that monitors whether the XMLHttpRequest object's readyState attribute has changed?

Answer: a. onreadystatechange

Question: 30
The onreadystatechange change event is used to invoke behavior when

Answer: d. the status of the asynchronous request changes.

Question: 31
What are the advantages of using JavaScript libraries (like jQuery) to implement Ajax?

Answer: c. Better cross-browser compatibility and faster speed of development

Question: 31
Which browser features and/or technologies must be enabled, at a minimum, for AJAX techniques to function properly?

Answer: d. JavaScript must be enabled.

Question: 32
The primary benefit of using AJAX techniques in a web application is:

Answer: c. It allows web applications to send asynchronous data requests to a server without a user initiated page load.

Question: 33
What arguments MUST be supplied to an XMLHttpRequest object's .open() method, and in what order?

Answer: b. HTTP method as string, URL as string, async flag as boolean

Question: 34
After a request completes, which property of the XMLHttpRequest object can be used to retrieve a DOM representation of a remote XML document?

Answer: d. responseXML

Question: 35
Which method on the XMLHttpRequest object is used to send custom HTTP headers with a request?

Answer: a. setRequestHeader

Question: 36
If an Ajax request loads JSON-formatted responseText into the variable returnedData, what code will turn the data into a readable JSON object in modern browsers, including IE8 and above?

Answer: c. JSON.parse(returnedData);

Don't Miss A Single Updates

Remember to check your email account to confirm your subscription.

Post a comment ➜

No Comment