Test 1 Flashcards
(138 cards)
- Which of the following is something you must have to run JavaScript?
a. a web browser
b. a program compiler
c. software that generates code for the web
d. all of the above
Answer: a. a web browser
- The choice of a web browser is up to you, as long it’s compatible with ________.
a. scripting plug-ins
b. VBScript
c. the version of JavaScript that you are using
d. any Windows operating system
Answer: c. the version of JavaScript that you are using
- JavaScript and Java are the same language. (true or false )
Answer:False
- JavaScript has similarities to other programming and scripting languages. (true or false )
Answer: True
Before its release as JavaScript, JavaScript was originally called __________.
a. Java
b. PerlScript
c. LiveScript
d. EasyScript
Answer: c.LiveScript
JavaScript was first introduced into which browser?
a. Netscape Navigator
b. Internet Explorer
c. Apple Safari
d. It was introduced into both A and B at the same time
Answer: a. Netscape Navigator
JavaScript is __________.
a. object based
b. function based
c. based on module structures
d. not a language that uses objects as does VBScript
Answer: A. object based
A _____ language doesn’t require a program to be compiled before it is run.
a. programming
b. server-side
c. scripting
d. all of the above
Answer: C. scripting
In a scripting language, the code is interpreted as it is loaded in the client. (ture/false)
Answer: True
In JavaScript, what handles errors in a script when it executes?
a. the web server
b. a programming compiler
c. the local computer’s operating system
d. all of the above
Answer: a. the web server
What HTML code is added to a web page in order to insert JavaScript code?
a. script tags
b. js tags
c. javascript tags
d. Both A and C are correct
script tags
As part of the parsing process, the browser creates a type of internal model known as a DOM (Document Object Model) representation based on the content of the loaded document. (ture or false)
Answer:True
The top level of the DOM hierarchy is occupied by _____________________.
a. the document object
b. the document method
c. the window method
d. the window object
Answer: d. the window object
When writing scripts, the window object must always be called as the first object in your hierarchy structure. (true or false )
Answer: false
The notation that we use to represent objects in the document tree structure uses the _____________________ to denote the hierarchy structure.
a. backslash
b. forward slash
c. dot or period
d. all of the above can be used
Answer: c. dot or period
The alert( ) method is a method that is part of which object (structure)?
a. the document object
b. the window object
c. both A and B
d. neither A nor B
Answer: b.the window object
The alert( ) method generates a message box whose appearance cannot be customized; it’s appearance is solely determined by the browser being used. (true or false )
Answer: True
The main limitation of using JavaScript in a web page is based on the fact that if it is applied for use as a client-side script, you cannot combine it with any type of client-side scripting such as ASP or PHP. (true or false )
Answer: True
. To write a string of text on a web page, the __________ method is used.
a. document.write ()
b. document.print ()
c. document,type ()
d. window.print ()
Answer: a. document.write ()
The __________ signals the end of a JavaScript statement.
a. colon
b. period
c. question mark
d. semicolon
Answer: d. semicolon
What is the purpose of the script > and script tags?
a. To tell the browser where a script begins and ends
b. To let the browser know the scripting language to be used
c. To point to an external JavaScript file
d. All of the above
Answer: d. All of the above
An external JavaScript file commonly uses a filename extension of ________.
a. .js
b. .html
c. .jav
d. .java
Answer: a. .js
Which of the following correctly points to an external JavaScript file named yourfile.js?
a. javascript type=“text/javascript” src=“yourfile.js”>
b. script type= “text/javascript” src=“yourfile.js”>
c. script href=“yourfile.js”>
d. javascript type=“text/javascript” href=“yourfile.js”>
Answer: b.
You cannot use any HTML tags – including the script tag – in your external JavaScript file being linked to your web page; you must include ONLY JavaScript code. (true or false)
Answer: True