JavaScript and Web Services Fundamentals

Test your knowledge of JavaScript programming fundamentals including arrays, functions, browser objects, timing, and web services concepts like SOAP.

15 Questions Published

Questions

Question 1 Multiple Choice (Single Answer)

Which of the following is true about SOAP?

  1. SOAP is for HTTP only
  2. SOAP can be used in combination with any protocol that can carry a SOAP envelope
  3. All the above
  4. none of the above
Question 2 Multiple Choice (Single Answer)

SOAP doesn't define a message exchange pattern

  1. a. true
  2. b. false, SOAP is completely a request/response protocol
  3. c. may be
  4. d. may not be
Question 3 Multiple Choice (Single Answer)

Characteristics of the Web Services programming model.

  1. a. Use Web protocols
  2. b. Are stateless
  3. c. Are loosely coupled
  4. Use XML as the universal data format
  5. e. a and c only
  6. f. all the above
Question 4 Multiple Choice (Single Answer)

Where is the correct place to insert a JavaScript in HTML Page?

  1. The <head> section
  2. Both the <head> section and the <body> section are correct
  3. The <body> section
  4. The <metadata> section
Question 5 Multiple Choice (Single Answer)

How do you create a function?

  1. function:myFunction()
  2. function myFunction()
  3. function=myFunction()
  4. function=myFunction(){ }
Question 6 Multiple Choice (Multiple Answers)

What is the correct JavaScript syntax to insert a comment ?

  1. /This comment has more than one line/
  2. <//This comment has more than one line//
  3. <!--This comment has more than one line-->
  4. //This is a comment
Question 7 Multiple Choice (Single Answer)

How do you round the number 10.75, to the nearest integer?

  1. Math.rand(10.75)
  2. Math.round(10.75)
  3. rnd(10.75)
  4. Math.rnd(10.75)
Question 8 Multiple Choice (Single Answer)

How do you put a message in the browser's status bar?

  1. statusbar = "put your message here"
  2. window.status("put your message here")
  3. window.status = "put your message here"
  4. status("put your message here")
Question 9 Multiple Choice (Single Answer)

How can you find a client's browser name?

  1. client.navName
  2. navigator.browser
  3. browser.name
  4. navigator.appName
Question 10 Multiple Choice (Single Answer)

var d=new Date(); theDay=d.getDay(); switch (theDay) { case 2: document.write("Today is Saturday"); break; case 4: document.write("Finally Friday"); break; case 5: document.write("Super Saturday"); break; case 6: document.write("Sleepy Sunday"); default: document.write("I'm looking forward to this weekend!"); } If today is Saturday, what will be out of the above snippet

  1. Super Saturday
  2. Finally Friday
  3. Sleepy Sunday I'm looking forward to this weekend!
  4. Sleepy Sunday
  5. Today is Saturday
Question 11 Multiple Choice (Single Answer)

What is the correct way to write a JavaScript array?

  1. var txt = new Array="tim","kim","jim";
  2. var txt = new Array("tim","kim","jim");
  3. var txt = new Array:1=("tim")2=("kim")3=("jim")
  4. var txt = new Array(1:"tim",2:"kim",3:"jim")
Question 12 Multiple Choice (Single Answer)

What is the syntax which will display the image on the screen for 5 seconds?

  1. setTimeout('run()','50000');
  2. setTimer('run()','5');
  3. setTimeout('run()','500');
  4. setTimeout('run()','5000');
Question 13 True/False

An external JavaScript must contain the

  1. True
  2. False
Question 14 Multiple Choice (Single Answer)

How do you write a conditional statement for executing some code if "i" is equal to 5?

  1. if i==5 then
  2. if i=5
  3. if (i==5)
  4. if i=5 then
Question 15 Multiple Choice (Single Answer)
  1. What does CSS stand for?
  1. Computer Style Sheets
  2. Cascading Style Sheets
  3. Creative Style Sheets
  4. Colorful Style Sheets