Deck 10: Creating Pop-Up Windows, Adding Scrolling Messages, and Validating Forms
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Unlock Deck
Sign up to unlock the cards in this deck!
Unlock Deck
Unlock Deck
1/112
Play
Full screen (f)
Deck 10: Creating Pop-Up Windows, Adding Scrolling Messages, and Validating Forms
1
The comparison,____,is true if a equals b and the data are of the same type.
A)a=b
B)a==b
C)a===b
D)a< >b
A)a=b
B)a==b
C)a===b
D)a< >b
C
2
The ____ object component of a scrolling message defines where the scrolling message displays.
A)visibility
B)message
C)display
D)text
A)visibility
B)message
C)display
D)text
C
3
A(n)____ is any expression that evaluates to true or false.
A)operand
B)logical
C)concatenation
D)condition
A)operand
B)logical
C)concatenation
D)condition
D
4
Which of the following conditional operators evaluates as true if both conditions are true?
A)&&
B)!!
C)==
D)!=
A)&&
B)!!
C)==
D)!=
Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck
5
The ____ component of a scrolling message regulates the speed in which the characters display in the text field.
A)delay
B)chronological
C)timing
D)speed
A)delay
B)chronological
C)timing
D)speed
Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck
6
To determine if the current value of the beginPos variable is greater than the length of the message,use the ____ statement.
A)for
B)comp
C)if
D)while
A)for
B)comp
C)if
D)while
Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck
7
Which of the following event handlers triggers JavaScript code when used with buttons and links?
A)onLoad
B)onUnload
C)onClick
D)onSubmit
A)onLoad
B)onUnload
C)onClick
D)onSubmit
Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck
8
The text field that displays a scrolling message must be part of a ____.
A)database
B)character set
C)condition
D)form
A)database
B)character set
C)condition
D)form
Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck
9
Conditional operators are used to compare two ____.
A)formulas
B)objects
C)functions
D)operands
A)formulas
B)objects
C)functions
D)operands
Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck
10
The first part of the if statement includes ____.
A)JavaScript statements to execute if condition is true
B)JavaScript statements to execute if condition is false
C)the if (condition)
D)none of the above
A)JavaScript statements to execute if condition is true
B)JavaScript statements to execute if condition is false
C)the if (condition)
D)none of the above
Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck
11
The ____ component of a scrolling message is the location of the next character in a text string.
A)display
B)position
C)location
D)space
A)display
B)position
C)location
D)space
Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck
12
The JavaScript statement,____,automatically adds 1 to a variable.
A)variable*1
B)variable = variable * 1
C)variable+++
D)variable++
A)variable*1
B)variable = variable * 1
C)variable+++
D)variable++
Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck
13
A ____ function should have a mechanism that terminates the function when it completes its task.
A)recursive
B)delay
C)timeout
D)concatenated
A)recursive
B)delay
C)timeout
D)concatenated
Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck
14
A(n)____ is an action,such as a mouse click or a window loading.
A)index
B)radix
C)method
D)event
A)index
B)radix
C)method
D)event
Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck
15
An operand is a ____ data type or value.
A)numerical
B)string
C)logical
D)all of the above
A)numerical
B)string
C)logical
D)all of the above
Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck
16
A scrolling message displays either in a text field within the Web page or on the ____.
A)status bar
B)address bar
C)menu bar
D)any of the above
A)status bar
B)address bar
C)menu bar
D)any of the above
Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck
17
Which of the following conditional operators always evaluates as true if a does not equal b?
A)a{b}
B)a==b
C)a >b
D)a!=b
A)a{b}
B)a==b
C)a >b
D)a!=b
Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck
18
Although scrolling text can be assigned to a < div > tag container using the ____ property,it does not allow for as much control as a form object like a text field or button.
A)outerHTML
B)marquee
C)scrollText
D)innerHTML
A)outerHTML
B)marquee
C)scrollText
D)innerHTML
Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck
19
When using a(n)< ____ > text field,you can format the text using an inline style.
A)message
B)input
C)msg
D)scroll
A)message
B)input
C)msg
D)scroll
Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck
20
When the user performs an action,such as a mouse click,which of the following associates that action with a function?
A)an event handler
B)the < body > tag
C)a conditional operand
D)the setTimeout()method
A)an event handler
B)the < body > tag
C)a conditional operand
D)the setTimeout()method
Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck
21
The ____ loop often is referred to as a counter-controlled loop.
A)while
B)until
C)do
D)for
A)while
B)until
C)do
D)for
Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck
22
When you set the focus to a text field,the JavaScript statement automatically positions which of the following in the text box?
A)the insertion point
B)the END statement
C)both a and b
D)neither a nor b
A)the insertion point
B)the END statement
C)both a and b
D)neither a nor b
Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck
23
Which of the following operators is used by the isNaN()built-in function?
A)NOT
B)AND
C)OR
D)none of the above
A)NOT
B)AND
C)OR
D)none of the above
Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck
24
Which of the following is a built-in function of JavaScript?
A)parseInt()
B)parseFloat()
C)isNaN()
D)all of the above
A)parseInt()
B)parseFloat()
C)isNaN()
D)all of the above
Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck
25
A(n)____ is a series of statements that executes repeatedly until it satisfies a condition.
A)index
B)baseline
C)loop
D)rotation
A)index
B)baseline
C)loop
D)rotation
Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck
26
The ____ loop relies on a conditional statement using numeric values.
A)do
B)while
C)until
D)for
A)do
B)while
C)until
D)for
Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck
27
Which of the following attributes supplied in the open()method allow you to determine the size at which the new window initially displays?
A)top and bottom
B)width and height
C)size and resolution
D)extend and contract
A)top and bottom
B)width and height
C)size and resolution
D)extend and contract
Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck
28
Which of the following raises 2 to the power of 3?
A)Math.pow(3,2)
B)Math.pow*2 *3
C)Math.pow(2,3)
D)Pow.math(2,3)
A)Math.pow(3,2)
B)Math.pow*2 *3
C)Math.pow(2,3)
D)Pow.math(2,3)
Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck
29
What type of value does the isNaN()function return?
A)variable
B)Boolean
C)integer
D)decimal
A)variable
B)Boolean
C)integer
D)decimal
Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck
30
The general form of the pow()method is ____.
A)Math.pow(number,exponent)
B)Math.pow(exponent,constant)
C)Math.pow(exponent)
D)Math.pow(number,constant)
A)Math.pow(number,exponent)
B)Math.pow(exponent,constant)
C)Math.pow(exponent)
D)Math.pow(number,constant)
Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck
31
Using an HTML ____ list can ensure that accurate values are entered.
A)option
B)select
C)radio
D)validated
A)option
B)select
C)radio
D)validated
Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck
32
If a condition in an if…else statement is true,the statements between the ____ after the if statement execute.
A)single quotation marks
B)angle brackets
C)parentheses
D)curly braces
A)single quotation marks
B)angle brackets
C)parentheses
D)curly braces
Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck
33
With the parseFloat()function,if the first character cannot be converted to a number,what is the result?
A)Null
B)NaN
C)Word
D)Radix
A)Null
B)NaN
C)Word
D)Radix
Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck
34
Which of the following methods creates a pop-up window?
A)window()
B)valueIn()
C)open()
D)none of the above
A)window()
B)valueIn()
C)open()
D)none of the above
Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck
35
Which of the following relies on a conditional statement that can use either a numeric value or a string?
A)while loop
B)for loop
C)until loop
D)none of the above
A)while loop
B)for loop
C)until loop
D)none of the above
Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck
36
Which of the following event handlers is used to trigger an action when a document is loaded into the browser window?
A)onClick
B)onSubmit
C)onDblClick
D)onLoad
A)onClick
B)onSubmit
C)onDblClick
D)onLoad
Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck
37
If a value of 12Wre is entered,parseInt()will convert to ____.
A)12
B)12W
C)12Wr
D)Wre
A)12
B)12W
C)12Wr
D)Wre
Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck
38
Which of the following is the general form for the JavaScript statement used to assign a value to a text field object within a form?
A)document.textfieldname.formname.value
B)textfieldname.value = variable_or_literal
C)document.formname.textfieldname.value = variable_or_literal
D)document.formname.textfieldname.value = variable_or_literal = documentname
A)document.textfieldname.formname.value
B)textfieldname.value = variable_or_literal
C)document.formname.textfieldname.value = variable_or_literal
D)document.formname.textfieldname.value = variable_or_literal = documentname
Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck
39
Which of the following is the general form of the focus()method?
A)document.objectname.eventname.focus()
B)document.formname.objectname.focus()
C)formname.objectname.document.focus()
D)document.focus()
A)document.objectname.eventname.focus()
B)document.formname.objectname.focus()
C)formname.objectname.document.focus()
D)document.focus()
Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck
40
Which of the following is NOT a step performed by the dollarFormat()function?
A)separating the value to the left of the decimal point as the dollar amount
B)separating the value to the right of the decimal point as the cents amount
C)performing a calculation that returns a dollar amount
D)inserting a dollar sign immediately to the left of the first digit without spaces
A)separating the value to the left of the decimal point as the dollar amount
B)separating the value to the right of the decimal point as the cents amount
C)performing a calculation that returns a dollar amount
D)inserting a dollar sign immediately to the left of the first digit without spaces
Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck
41
"Next" statements are used to define one or more statements that only should be executed based on the result of a conditional test.
Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck
42
One reason to avoid assigning a scrolling message to the status bar is that users often do not look at the status bar.
Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck
43
Which of the following objects is used with the onLoad event handler?
A)button
B)window
C)hyperlink
D)document
A)button
B)window
C)hyperlink
D)document
Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck
44
Which of the following is a basic component of a scrolling message?
A)the message
B)the position
C)the delay
D)the table
A)the message
B)the position
C)the delay
D)the table
Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck
45
Which of the following can have values assigned to it?
A)text field
B)button
C)status bar
D)title bar
A)text field
B)button
C)status bar
D)title bar
Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck
46
The value property can be used to assign text to the contents of a text field.
Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck
47
If operands are of the same data type,you will not get a true comparison result.
Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck
48
Which of the following is a variable required by the user-defined scrollingMsg()function?
A)decipos
B)adMsg
C)scrollVar
D)beginPos
A)decipos
B)adMsg
C)scrollVar
D)beginPos
Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck
49
To cause a message to scroll in the text field,you must increment the position locator variable by 5.
Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck
50
The scrolling message is a text string assigned to a variable.
Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck
51
The substring()method needs two parameters (x,y),where x is the starting point of the string and y is the location of the first character placed in the string.
Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck
52
The position is the length of time between when a scrolling message ends and when it starts to appear again.
Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck
53
The statement,beginPos = beginPos * 1,increments the beginPos locator by 1.
Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck
54
The display object component of a scrolling message is a text string assigned to a variable._________________________
Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck
55
Which of the following statements increments a variable by one?
A)++variable
B)variable = variable * 1
C)variable+++
D)variable++
A)++variable
B)variable = variable * 1
C)variable+++
D)variable++
Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck
56
A scrolling message has three basic components._________________________
Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck
57
The comparison,a===b,is true if a equals b and if the data are of the same type._________________________
Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck
58
The comparison,a< b,is true if a is less tha b
Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck
59
Stopping text in an < input > text field has predictable results._________________________
Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck
60
A domain is a range of acceptable values for a field or column in a database._________________________
Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck
61
Web developers use multiple techniques to validate Web forms using JavaScript.
Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck
62
The Submit button object generally is used with the ____________________ event handler.
Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck
63
When the initial value of the ____________________ variable is zero,the code sets the string message so the first character of the string appears in the text field.
Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck
64
The isNaN()function is one of several functions that tests a numeric value as the argument.
Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck
65
JavaScript has three types of loops: for loops,while loops,and if...then loops.
Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck
66
The setTimeout()method is added at the end of the scrollingMsg()function to create a pause before it calls the scrollingMsg()function again.
Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck
67
JavaScript uses typical programming language symbols to represent exponentiation in code.
Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck
68
Attempting to place nested if statements to validate a series of text fields will not work with event-driven programming.
Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck
69
The break()method is used to split a string based on an identified separator and a desired number of "sub" strings.
Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck
70
The ____________________ object generally is used with the onLoad and onUnload event handlers.
Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck
71
The onLoad event handler is placed with its associated function in the < html > tag to indicate that the onLoad event handler should call the function when the Web page loads.
Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck
72
In an if…else statement,the statements between the curly braces after the else statement execute if the condition is true.
Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck
73
The Math object can be used to create other objects.
Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck
74
The isNaN()function converts a variable to a number.
Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck
75
The statement,window.setTimeout("scrollingMsg()",200),calls the function scrollingMsg()every 200 seconds,allowing the message to scroll continuously through the text box.
Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck
76
When a user triggers an event that calls a function,processing stays within that function until all statements execute.
Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck
77
Most of the properties of the Math object return preset values.
Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck
78
____________________ is a programming technique used to call the same function from within the function.
Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck
79
The ____________________ method calls a function or evaluates an expression after a specified amount of time has elapsed,which is measured in milliseconds.
Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck
80
In the statement,onLoad="scrollingMsg()",scrollingMsg is the event handler.
Unlock Deck
Unlock for access to all 112 flashcards in this deck.
Unlock Deck
k this deck