JavaScript and Web Services Fundamentals
Test your knowledge of JavaScript programming fundamentals including arrays, functions, browser objects, timing, and web services concepts like SOAP.
Questions
Which of the following is true about SOAP?
- SOAP is for HTTP only
- SOAP can be used in combination with any protocol that can carry a SOAP envelope
- All the above
- none of the above
SOAP doesn't define a message exchange pattern
- a. true
- b. false, SOAP is completely a request/response protocol
- c. may be
- d. may not be
Characteristics of the Web Services programming model.
- a. Use Web protocols
- b. Are stateless
- c. Are loosely coupled
- Use XML as the universal data format
- e. a and c only
- f. all the above
Where is the correct place to insert a JavaScript in HTML Page?
- The <head> section
- Both the <head> section and the <body> section are correct
- The <body> section
- The <metadata> section
How do you create a function?
- function:myFunction()
- function myFunction()
- function=myFunction()
- function=myFunction(){ }
What is the correct JavaScript syntax to insert a comment ?
- /This comment has more than one line/
- <//This comment has more than one line//
- <!--This comment has more than one line-->
- //This is a comment
How do you round the number 10.75, to the nearest integer?
- Math.rand(10.75)
- Math.round(10.75)
- rnd(10.75)
- Math.rnd(10.75)
How do you put a message in the browser's status bar?
- statusbar = "put your message here"
- window.status("put your message here")
- window.status = "put your message here"
- status("put your message here")
How can you find a client's browser name?
- client.navName
- navigator.browser
- browser.name
- navigator.appName
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
- Super Saturday
- Finally Friday
- Sleepy Sunday I'm looking forward to this weekend!
- Sleepy Sunday
- Today is Saturday
What is the correct way to write a JavaScript array?
- var txt = new Array="tim","kim","jim";
- var txt = new Array("tim","kim","jim");
- var txt = new Array:1=("tim")2=("kim")3=("jim")
- var txt = new Array(1:"tim",2:"kim",3:"jim")
What is the syntax which will display the image on the screen for 5 seconds?
- setTimeout('run()','50000');
- setTimer('run()','5');
- setTimeout('run()','500');
- setTimeout('run()','5000');
An external JavaScript must contain the
- True
- False
How do you write a conditional statement for executing some code if "i" is equal to 5?
- if i==5 then
- if i=5
- if (i==5)
- if i=5 then
- What does CSS stand for?
- Computer Style Sheets
- Cascading Style Sheets
- Creative Style Sheets
- Colorful Style Sheets