JavaScript Fundamentals Quiz
Test your knowledge of JavaScript programming including syntax, functions, objects, events, cookies, and browser compatibility
Questions
Consider an HTML form with a checkbox and a text field. When data is entered and the return key is pressed, the data seems to be lost before the user can click on the button that calls the processing function. How do you correct this?
- Add a TYPE=HIDDEN INPUT to the form
- Trap the return keypress and return (null
- Add 'return false' to onsubmit="..." in the FORM tag
- Instruct the user not to press the Return key.
Which JavaScript feature uses JAR files?
- Object signing
- Style sheets
- Netcaster channels
- Image rollovers
Which feature is supported in MSIE 3.x?
- split()
- document.clear()
- join()
- charAt()
What's the default setting for the expires attribute of the document.cookie property?
- The duration of the browser session.
- The duration the current document stays loaded.
- Twenty-four hours from the time the cookie is set.
- There is no default setting.
Which of the following is true?
- If onKeyDown returns false, the key-press event is cancelled.
- If onKeyPress returns false, the key-down event is cancelled.
- If onKeyDown returns false, the key-up event is cancelled.
- If onKeyPress returns false, the key-up event is cancelled.
Which best describes JavaScript?
- a low-level programming language.
- a scripting language precompiled in the browser.
- a compiled scripting language.
- an object-oriented scripting language.
Choose the server-side JavaScript object:
- FileUpLoad
- Function
- File
- Date
Choose the client-side JavaScript object:
- Database
- Cursor
- Client
- FileUpLoad
Seek the truth about setTimeOut():
- The statement(s) it executes run(s) only once.
- It pauses the script in which it is called.
- clearTimeOut() won't stop its execution.
- The delay is measured in hundredths of a second.
Which best describes void?
- A method
- A function
- A statement
- An operator
Inside which HTML element do we put the JavaScript?
- <javascript>
- <script>
- <js>
- <scripting>
What is the correct JavaScript syntax to write "Hello World"?
- ("Hello World")
- document.write("Hello World")
- response.write("Hello World")
- "Hello World"
What is the correct syntax for referring to an external script called "javascript.js"?
- <script type="text/javascript" name="javascript.js">
- <script type="text/javascript" src="javascript.js">
- <script type="text/javascript" href="javascript.js">
- <script type="text/javascript" link="javascript.js">
How do you round the number 7.25, to the nearest integer?
- rnd(7.25)
- round(7.25)
- Math.round(7.25)
- Math.rnd(7.25)
How can you find a client's browser name?
- browser.name
- navigator.appName
- client.navName
- clientbrowser.navName