Shared Flashcard Set

Details

JavaScript Objects & Events
JavaScript Objects & Events
108
Computer Science
Undergraduate 1
05/13/2009

Additional Computer Science Flashcards

 


 

Cards

Term
The windows, frames, and XHTML elements displayed by a Web browser can be manipulated by using methods and properties of JavaScript’s document object model.
Definition
True
Term
In JavaScript’s document object model, the Document object is a direct descendant of the Location object.
Definition
False
Term
It is not always necessary to include the Window object when listing an object's ancestors because the browser assumes you are referring to the currently displayed window.
Definition
True
Term
An alternate way of referring to the Window object is by using the parent property.
Definition
False
Term
The alert() Window object method displays a dialog box and requires the user to enter information.
Definition
False
Term
When a new browser window is opened, a new Window object is created for the new window.
Definition
True
Term
If a programmer excludes the options string of the open() method, then the browser will display all the normal options in the new browser window.
Definition
True
Term
To control a new window using JavaScript, the new window must be created and assigned to a variable.
Definition
True
Term
The setTimeout() method can be used to repeatedly execute some code after a specified amount of time has elapsed.
Definition
False, this is done by the setInterval() method
Term
The href property of the Location object contains the full URL address of the object.
Definition
True
Term
A list of all documents that have been opened in a Web browser session is maintained by the History object.
Definition
True
Term
Alternate names for the __________ object model include the browser object mode, the client-side object model, and the Navigator object model.
Definition
Document or Javascript
Term
In the JavaScript object model, an XHTML page displayed in a browser window is represented by a(n) __________ object.
Definition
document
Term
When referring to a JavaScript object in code, all of its ancestors must be referred to as a series of __________ separated by periods.
Definition
properties
Term
The self property refers to the current __________ object.
Definition
window
Term
After using the open() method to create a new window, the focus can be returned to the original browser window by coding the statement __________.
Definition
self.focus
Term
The time value specified in a setTimeout() method call is measured in __________.
Definition
milliseconds
Term
The __________ method is used to cancel a setInterval() method before it executes its associated code.
Definition
clearInterval()
Term
JavaScript can modify individual portions of a URL by accessing the properties of the __________ object.
Definition
location
Term
It is possible to navigate directly to a previously visited Web page using the go() method of the __________ object.
Definition
history
Term
The Web browser name, version, and language being used are all properties of the __________ object.
Definition
navigator
Term
The event that occurs when a mouse pointer is positioned on top of a link or image is a mouseOn.
Definition
False - this is the mouseover event
Term
The name attribute is case-sensitive.
Definition
True
Term
Code that executes when a particular event occurs is an event interpreter.
Definition
False - this is called an event handler
Term
It is possible to override a standard event handler and execute custom code by adding an event handler to an <a> tag.
Definition
True
Term
When a mouse passes over a link in an XHTML document, by default the link's URL is displayed in the address box.
Definition
False - by default it is displayed in the status bar
Term
A method is a function that is called from within a(n) __________.
Definition
object
Term
Actions that users take, such as clicking the mouse, or moving the mouse over an image, are called __________.
Definition
events
Term
Input fields that interact with users can be created in an XHTML document using the __________ element.
Definition
<input />
Term
Input fields that interact with users can be created in an XHTML document using the __________ element.
Definition
<input />
Term
An event __________ is program code that is executed in response to a specific event.
Definition
handler
Term
When a hypertext link is clicked, the click event is executed and the link's associated __________ is opened.
Definition
URL
Term
It is possible to define hidden form fields that will not be displayed by a Web browser.
Definition
True
Term
Every element in a form can be accessed without using a name by accessing the elements[] array of the Form object.
Definition
True, e.g. document.forms[0].elements[0]
Term
The onReset event handler can be used to confirm that a user really wants to reset the form fields.
Definition
True
Term
The Form object has three methods; submit(), reset(), and receive().
Definition
False - The Form object only has two methods; submit(), and reset().
Term
The action property of the Form object contains the URL where form data will be sent when it is submitted.
Definition
True
Term
Form validation is the process of checking form entries to eliminate possible errors.
Definition
True
Term
In server-side validation, the server checks the user's input and then returns the correct input to the user.
Definition
False
Term
In client-side validation, the form is checked as the user enters information, and immediate feedback is provided if the user makes a mistake.
Definition
True
Term
Client-side validation is performed by a JavaScript.
Definition
True
Term
JavaScript is an object-based language.
Definition
True
Term
The topmost object in the JavaScript object hierarchy is the window.
Definition
True
Term
Some JavaScript objects have many properties, whereas other objects might have only one property.
Definition
True
Term
The syntax for changing the value of a property is object.expression = property
Definition
False, it would be object.property = expression
Term

To assign an object property value to a variable, use the syntax:

 

 variable = object.property

Definition
True
Term
Some properties are read-only, which means that you can read the property value, but you cannot change it.
Definition
True
Term
The JavaScript window object close() method closes a window.
Definition
True
Term
To apply a method to an object, use the syntax: object.method();
Definition
True
Term
The write() method contains parameters.
Definition
True
Term
Click is an event that occurs when the value of a form field is changed by the user.
Definition
False
Term
Focus is an event that occurs when a window or form field is made active.
Definition
True
Term
The act of tabbing into an input field is an event.
Definition
True
Term
The onClick event handler activates a submit button.
Definition
True
Term
The event handler for opening a Web page is onLoad.
Definition
True
Term
The onLoad event handler must be placed outside of the <body>…</body> element of the XHTML file.
Definition
False - should be <body onLoad=  >
Term
When you use JavaScript to emulate an event, you are causing the Web page to perform an action for the user.
Definition
True
Term
focus() is an event method.
Definition
True
Term

In the command,

document.orders.product.blur();

document is an object.

Definition
True
Term

In the command:

document.orders.product.blur();

blur() is an event method.

Definition
True
Term

To move to a field on a Web page form, use the JavaScript command:

document.form.field.focus();

Definition
True
Term
Length, name, and selectedIndex are properties of options in a selection list.
Definition
False, these are properties of the option object, which is an option in a selection list
Term
The selected property of an option in a selection list is a Boolean value that indicates whether the option is currently selected.
Definition
True
Term
The prompt() method creates a dialog box containing a message and an input field into which the user can type a value or text string.
Definition
True
Term
Prompt dialog boxes look exactly the same when they open in different Web browsers.
Definition
False
Term
You can store the result returned by a prompt() method in a variable or place it in an object.
Definition
True
Term
You use the eval() function to change a text value into a numeric value.
Definition
True
Term
A dialog box that opens after a user action to inform the user that the response was invalid is a prompt dialog box.
Definition
False - this will typically be an 'alert' which does not allow user input.
Term
A dialog box that opens in the Web browser to inform the user that the entered value is incorrect is an error dialog box.
Definition
False - again, typically an alert is used
Term
The checked property of a check box is a Boolean value that indicates whether or not the check box has been checked.
Definition
True
Term
The syntax for loading a page in the Web browser is location = URL; where URL is the text string of the URL of the page you want to load.
Definition
True? -  book says, location.href = 'URL'
Term
Using check boxes, selection lists, and radio buttons as often as possible is a good way of controlling which values are appropriate to enter into each field.
Definition
True
Term
You should make sure that the messages in alert and prompt dialog boxes are clear and precise, and that they inform the user exactly of any error made.
Definition
True
Term
The element, <input type="__________" /> creates a field that cannot be displayed by the Web browser or updated by the user.
Definition
hidden
Term
When a form is to be submitted to a CGI script, every form element must be defined with a(n) __________ attribute.
Definition
name
Term
The event handler that executes when a form is submitted to a CGI script, either by using a submit or an image <input /> element, is the __________ event handler.
Definition
onSubmit
Term
The form object includes a(n) __________ array that represents all the elements of a form.
Definition
elements[]
Term
Form data can also be sent to an e-mail address by specifying a mailto: address on the __________ attribute of the <form>…</form> element.
Definition
action
Term
The process of ensuring that a value entered into a form is valid is called _________.
Definition
form validation
Term
In __________ validation, the user submits the form to a server, where it is checked and returned to the user if mistakes are encountered.
Definition
server-side
Term
In __________ validation, the form is checked as the user enters information, and immediate feedback is provided if mistakes are encountered.
Definition
client-side
Term
The JavaScript object name for the history list is __________.
Definition
history
Term
The JavaScript object name for a form is __________.
Definition
form
Term
The XHTML command to begin a form named MKT is __________.
Definition
<form name='MKT' ..> .. </form>
Term
The appVersion property of the navigator object identifies the version number of your Web browser; this is a(n) __________ property.
Definition
read-only
Term
The syntax for assigning a property to a variable is _________.
Definition
variable=object.property
Term
You can use the __________ statement to modify properties in a conditional statement that changes how the page behaves based on the value of an object property.
Definition
if else
Term
The method that displays a dialog box with a message in the window is __________.
Definition
alert()
Term
The method that goes to the next page in the history list is __________.
Definition
forward
Term
The method that writes text and XHTML tags to the current document on a new line is __________.
Definition
writeln()
Term
The method that resets a form is __________.
Definition
reset()
Term
The event that occurs when the user clicks a field or a hyperlink with the mouse is __________.
Definition
click
Term
The event that occurs when the user cancels the loading of an image is __________.
Definition
abort
Term
The event that occurs when the user leaves a form field (either by clicking outside the field or pressing the Tab key) is __________.
Definition
blur
Term
The syntax for the prompt() method is
Definition
prompt("message","default text");
Term
In the command UserName=prompt("Enter your name","Type name here"); the default text that appears in the input text box is __________.
Definition
Type name here
Term
In the command UserName=prompt("Enter your name","Type name here"); the message that appears in the dialog box is __________.
Definition
Enter your name
Term
The __________ keyword is a reserved word in JavaScript that refers to the currently selected object.
Definition
this
Term
You can use the __________ keyword to pass information about the currently selected field to a function.
Definition
this
Term
The __________ method displays a dialog box that informs the user of an error and includes an OK button for the user to acknowledge the error.
Definition
alert()
Term
The syntax of the alert() method is __________.
Definition
alert("Alert text here");
Term
The syntax for the confirm() method is __________.
Definition
confirm("confirm message");
Term
If the user clicks the OK button in a confirm dialog box, the method returns a value of __________.
Definition
True
Term
The syntax for an alert dialog box that includes a message with the text, "You must press the Enter key to continue," is __________.
Definition
alert("You must press the Enter key to continue,");
Term
The __________ method displays a dialog box that informs the user of a message and includes an OK button to continue and a Cancel button to cancel the request.
Definition
confirm()
Term
The syntax for a confirm dialog box that includes a message with the text, "OK to continue?" is __________.
Definition
confirm("OK to continue?");
Supporting users have an ad free experience!