Translate

Monday, July 22, 2013

oDesk Elance test Answers 2013 (AJAX Test Questions)

32% off New Product orders at GoDaddy.com! Expires 7/30/13.

oDesk Elance test Answers 2013 (AJAX Test Questions)



oDesk Answer Test (AJAX Test Questions)


Question: 01
Is JavaScript the same as Java?


    a.     yes
    b.     no


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


    a.     _my_var
    b.     2myVar
    c.     MY_VAR
    d.     __MyVar2__
    e.     All are valid


Question: 03
Which HTTP server does AJAX require?


    a.     Apache
    b.     Sun application server
    c.     lighttpd
    d.     Microsoft web server
    e.     Any HTTP server will work


Question: 04
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?

    a.     Type of request
    b.     Resource to access
    c.     Version of HTTP
    d.     Browser name
    e.     None of the above


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


    a.     var oReq = new XMLHttpRequest ();
    b.     var oReq = new ActiveXObject ("MSXML2.XMLHTTP.3.0");
    c.     var oReq = new IEHttpRequest ("XML");
    d.     None of the above


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


    a.     The browser back button cannot be used in most cases    b.     It makes the server and client page representation synchronization more difficult
    c.     It loads the server too much
    d.     It's not supported by older browsers
    e.     It augments the used bandwidth significantly


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


    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)

    d.     It requires a special AJAX enabled web server
    e.     It cannot be used under Internet Explorer


Question: 08
Is it possible to access the browser cookies from a javascript application?


    a.     yes
    b.     no


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


    a.     It's an engine developed by Microsoft to load web pages faster
    b.     It's merely a concept with many implementation methods (XMLHttpRequest, iFrames...)
    c.     It's a server side scripting language used to serve partial parts of a webpage
    d.     It's a good way to reduce network traffic, if used correctly

    e.     None of the above


Question: 10
Which of the following navigator properties is the same in both Netscape and IE?


    a.     navigator.appName
    b.     navigator.appCodeName
    c.     navigator.appVersion
    d.     navigator.userAgent
    e.     None of the above


Question: 11
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>

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

    c.     var myDiv = document.getElementById ("statusCode");
myDiv.setStatus (req.statusCode);
    d.     var myDiv = document.getElementById ("statusCode");
myDiv.status = req.status;
    e.     None of the above


Question: 12
Which of the following describes the term 'Asynchronous' correctly?


    a.     Ability to handle processes independently from other processes
    b.     Processes are dependent upon other processes
    c.     Processes are not fully dependent on other processes
    d.     None of the above


Question: 13
What should be called before 'send ()' to prepare an XMLHttpRequest object?


    a.     prepare ()
    b.     open ()
    c.     init ()
    d.     build ()
    e.     None of the above


Question: 14
document.write ("Hello");  will pop a dialog box with "Hello" in it.


    a.     true
    b.     false


Question: 15
What is the correct syntax to include a script named myScript.js into a page?


    a.     <script href="myScript.js">
    b.     <script name="myScript.js">
    c.     <script src="myScript.js">
    d.     <script root="myScript.js">


Question: 16
Can an HTML form be sent with AJAX?


    a.     yes
    b.     no


Question: 17
Is it possible to make some system calls on the client with AJAX?


    a.     Yes
    b.     No


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


    a.     Yes
    b.     No


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


    a.     window.setTimeout(checkState, 10);
    b.     window.setTimeout(checkState, 10000);
    c.     window.setTimeout(checkState(), 10);
    d.     None of the above


Question: 20
What is NOSCRIPT tag for?


    a.     To prevent the page scripts from executing
    b.     To shield a part of a page from being modified by JS (like aDiv.innerHTML = 'something' has no effect)
    c.     To enclose text to be displayed if the browser doesn't support JS
    d.     NOSCRIPT tag doesn't exist
    e.     None of the above


Question: 21
What is the standardized name of JavaScript?


    a.     Java
    b.     NetscapeScript
    c.     ECMAScript
    d.     XMLScript
    e.     WebScript


Question: 22
Which of the following browsers provide XMLHttpRequest property?

    a.     Internet Explorer 5
    b.     Internet Explorer 6
    c.     Internet Explorer 7
    d.     Firefox 2.0
    e.     Safari 3.0



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


    a.     myReq.request();
    b.     myReq.get();
    c.     myReq.post(null);
    d.     myReq.send(null);
    e.     myReq.sendRequest(null);


Question: 24
Can you start multiple threads with JavaScript?


    a.     Yes
    b.     No


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


    a.     myRequest.onreadystatechange = calc;
    b.     myRequest.onload = calc;
    c.     myRequest.execute = calc;
    d.     myRequest.addCallback (calc, "loaded");
    e.     None of the above


Question: 26
When a user views a page with JavaScript in it, which machine executes the script?


    a.     The client machine running the Web Browser
    b.     The server serving the JavaScript
    c.     A central JavaScript server like root DNS
    d.     None of the above


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


    a.     responseData
    b.     responseBody
    c.     responseString
    d.     responseText
    e.     responseXML


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


    a.     <!-- -->
    b.     /* */
    c.     //
    d.     #
    e.     --[[ ]]


Question: 29
Can an AJAX application communicate with other applications on the client computer?


    a.     Yes
    b.     No


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


    a.     Partial page processing
    b.     Unresponsiveness of web pages
    c.     Server side communication initiation
    d.     Server crashes (failover)
    e.     None of the above


Question: 31
Is it always possible to make requests to multiple websites with different domain names from an AJAX client script?

    a.     yes
    b.     no


Question: 32
Can AJAX be used with offline pages? (like a downloadable documentation)


    a.     yes
    b.     no


Question: 33
In the following list, which states are valid?


XMLHttpRequest.readyState

    a.     0, The request is not initialized
    b.     1, The request has been set up
    c.     2, The request has been sent
    d.     3, The request is in process
    e.     4, The request is complete
    f.     All of the above.


Question: 34
Can AJAX be used with PHP?


    a.     yes
    b.     no


Question: 35
What is the correct syntax to create an array in JavaScript?


    a.     var array = Array.new;
    b.     var array = [];
    c.     var array = new Array;
    d.     var array = new Array ();
    e.     None of the above


Question: 36
Which of the following is/are not addressed by AJAX?


    a.     Partial page update
    b.     Offline browsing
    c.     Server side scripting
    d.     All of the above


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


    a.     myReq.setContentType ("text/xml");
    b.     myReq.contentType = "text/xml";
    c.     myReq.overrideContentType ("xml");
    d.     myReq.contentType = "xml";
    e.     myReq.setRequestHeader ("Content-Type", "text/xml");

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


    a.     new
    b.     delete
    c.     this
    d.     typeof
    e.     All of the above are Javascript operators


Question: 39
Can a client AJAX application be used to fetch and execute some JavaScript code?


    a.     yes
    b.     no


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


    a.     no
    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.


##Can AJAX be used to move files on the client-side?
  • a. Yes
  • b. No

Is it possible to create and manipulate an image on the client with AJAX?
  • a. yes
  • b. no
#12 Question:
Is the loading of an AJAX enabled web page any different from the loading of a normal page?
  • a. No
  • b. Yes
#14 Question:
Does JavaScript 1.5 have exception handling?
  • a. yes
  • b. no
What language does AJAX use on the client side?
  • a. JavaScript
  • b. AppleScript
  • c. PHP
  • d. Ruby
  • e. Java
#23 Question:
Which attribute of the SCRIPT tag can be used to hold the JavaScript version?
  • a. VERSION
  • b. SCRIPT
  • c. LANGUAGE
  • d. MILESTONE
  • e. None of the above
Can you call responseBody or responseText to get a partial result when the readyState of an XMLHttpRequest is 3(receiving)?
  • a. Yes
  • b. No
Which of the following status codes denotes a server error?
  • a. 100
  • b. 200
  • c. 300
  • d. 404
  • e. 500
What is true regarding XMLHttpRequest.abort()?
  • a. It can only be used with async requests
  • b. It will remove the onreadystatechange event handler
  • c. It will send an abort message to the remote server
  • d. It changes readyState to 4 (aborted)
  • e. None of the above
Can AJAX be used with HTTPS (SSL)?
  • a. yes
  • b. no

When doing an AJAX request, will the page be scrolled back to top as with normal requests?
  • a. Yes
  • b. No
What is the third (async) parameter of the XMLHttpRequest open method?
  • a. If true, the request doesn't return anything.
  • b. If true, the javascript engine is blocked while making the request
  • c. If true, the send method returns immediately
  • d. If true, the request object is destroyed when 'send' is executed
  • e. If true, callbacks are executed
When may asynchronous requests be used?
  • a. To submit data to the server
  • b. To retrieve data from the server
  • c. To load additional code from the server
  • d. To download an image
  • e. All of the above
Consider the following function:

function foo ()
{
return 5;
}

What will the following code do?

var myVar = foo;
  • a. Assign the integer 5 to the variable myVar
  • b. Assign the pointer to function foo to myVar
  • c. Do nothing
  • d. Throw an exception
  • e. None of the above
Javascript uses static bindings.
  • a. true
  • b. false
Which of the following request types should be used with AJAX?
  • a. HTTP GET request for retrieving data (which will not change for that URL)
  • b. HTTP POST request for retrieving data (which will not change for that URL)
  • c. HTTP GET should be used when the state is updated on the server
  • d. HTTP POST should be used when the state is updated on the server
The server returns data to the client during an AJAX postback. Which of the following is correct about the returned data?
  • a. It only contains the data of the page elements that need to be changed
  • b. It contains both the data of the whole page and the data that needs to be changed in separate blocks
  • c. It contains the data of the whole page
  • d. It may contain anything
  • e. None of the above
The X in AJAX refers to XML, but is it possible to make a request for plain text data by using AJAX?
  • a. yes
  • b. no
32% off New Product orders at GoDaddy.com! Expires 7/30/13.