Sei sulla pagina 1di 4

oDesk and Elance AJAX Test Answers - 2014

oDesk and Elance AJAX Test Answers - 2014


Question:- Is JavaScript the same as Java?
Answer:- b. no
Question:- Which of the following is not a valid variable name in JavaScript?
Answer:- b. 2myVar
Question:- Which HTTP server does AJAX require?
Answer:- e. Any HTTP server will work
Question:- The format of an HTTP request is given below:
<request-line>
<headers>
<blank line>
[<request-body>]
Which of the following is not passed in the request-line?
Answer:- e. None of the above
Question:- How can you create an XMLHttpRequest under Internet Explorer 6?
Answer:- b. var oReq = new ActiveXObject (MSXML2.XMLHTTP.3.0?);
Question:- Which of the following list is/are true regarding AJAX?
Answer:- a. It can only be implemented with the XMLHttpRequest object
b. It can be used to update parts of a webpage without reloading it
c. It can be used to make requests to the server without blocking the user (async)
Question:- Is it possible to access the browser cookies from a javascript application?
Answer:- a. yes
Question:- Which of the following is/are true regarding AJAX?
Answer:- a. Its an engine developed by Microsoft to load web pages faster
b. Its merely a concept with many implementation methods (XMLHttpRequest, iFrames)
c. Its a server side scripting language used to serve partial parts of a webpage
d. Its a good way to reduce network traffic, if used correctly
Question:- Which of the following navigator properties is the same in both Netscape and IE?
Answer:- b. navigator.appCodeName
Question:- 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:- Which of the following describes the term Asynchronous correctly?
Answer:- a. Ability to handle processes independently from other processes
Question:- What should be called before send () to prepare an XMLHttpRequest object?
Answer:- b. open ()
Question:- document.write (Hello); will pop a dialog box with Hello in it.
Answer:- b. false
Question:- What is the correct syntax to include a script named myScript.js into a page?
Answer:- c. <script src=myScript.js>
Question:- Can an HTML form be sent with AJAX?
Answer:- a. yes
Question:- Is it possible to make some system calls on the client with AJAX?

Answer:- b. No
Question:- Can WebDav methods like PROPFIND be used with XMLHttpRequest.open()?
Answer:- a. Yes
Question:- What is the correct way to have the function checkState called after 10 seconds?
Answer:- b. window.setTimeout(checkState, 10000);
Question:- What is NOSCRIPT tag for?
Answer:- c. To enclose text to be displayed if the browser doesnt support JS
Question:- What is the standardized name of JavaScript?
Answer:- c. ECMAScript
Question:- Which of the following browsers provide XMLHttpRequest property?
Answer:- c. Internet Explorer 7
d. Firefox 2.0
e. Safari 3.0
Question:- What is the common way to make a request with XMLHttpRequest?
Answer:- d. myReq.send(null);
Question:- Can you start multiple threads with JavaScript?
Answer:- b. No
Question:- What is the correct way to execute the function calc() when an XMLHttpRequest is loaded?
Answer:- a. myRequest.onreadystatechange = calc;
Question:- When a user views a page with JavaScript in it, which machine executes the script?
Answer:- a. The client machine running the Web Browser
Question:- In the following list, which ones are used to fetch the result data of an XMLHttpRequest?
Answer:- e. responseXML
Question:- Which of the following is a block comment in JavaScript?
Answer:- b. /* */
Question:- Can an AJAX application communicate with other applications on the client computer?
Answer:- b. No
Question:- Which of the following cannot be resolved by using AJAX?
Answer:- d. Server crashes (failover)
Question:- Is it always possible to make requests to multiple websites with different domain names from an
AJAX client script?
Answer:- a. yes
Question:- Can AJAX be used with offline pages? (like a downloadable documentation)
Answer:- b. no
Question:- In the following list, which states are valid?
XMLHttpRequest.readyState
Answer:- f. All of the above.
Question:- Can AJAX be used with PHP?
Answer:- a. yes
Question:- What is the correct syntax to create an array in JavaScript?
Answer:- d. var array = new Array ();
Question:- Which of the following is/are not addressed by AJAX?
Answer:- b. Offline browsing

Question:- 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:- Which of the following is not a JavaScript operator?
Answer:- e. All of the above are Javascript operators
Question:- Can a client AJAX application be used to fetch and execute some JavaScript code?
Answer:- b. no
Question:- 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:- ##Can AJAX be used to move files on the client-side?
Answer:- b. No
Question:- Is it possible to create and manipulate an image on the client with AJAX?
Answer:- a. yes
Question:- Is the loading of an AJAX enabled web page any different from the loading of a normal page?
Answer:- b. Yes
Question:- Does JavaScript 1.5 have exception handling?
Answer:- a. yes
Question:- What language does AJAX use on the client side?
Answer:- a. JavaScript
Question:- Which attribute of the SCRIPT tag can be used to hold the JavaScript version?
Answer:- a. VERSION
Question:- Can you call responseBody or responseText to get a partial result when the readyState of an
XMLHttpRequest is 3(receiving)?
Answer:- b. No
Question:- Which of the following status codes denotes a server error?
Answer:- e. 500
Question:- What is true regarding XMLHttpRequest.abort()?
Answer:- a. It can only be used with async requests
b. It will remove the onreadystatechange event handler
Question:- Can AJAX be used with HTTPS (SSL)?
Answer:- a. yes
Question:- When doing an AJAX request, will the page be scrolled back to top as with normal requests?
Answer:- b. No
Question:- When may asynchronous requests be used?
Answer:- c. To load additional code from the server
Question:- 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:- Javascript uses static bindings.
Answer:- b. false

Question:- Which of the following request types should be used with AJAX?
Answer:- a. HTTP GET request for retrieving data (which will not change for that URL)
d. HTTP POST should be used when the state is updated on the server
Question:- 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:- The X in AJAX refers to XML, but is it possible to make a request for plain text data by using
AJAX?
Answer:- a. yes

Potrebbero piacerti anche