Test 3 Flashcards

(93 cards)

1
Q

The JavaScript language is widely used for:

A

web-based client- side scripting

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

JavaScript essentially enables Web 2.0, the ________ side of the World Wide Web

A

dynamic

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

JavaScript is an implementation of __________ and developed by Brendan Eich & Netscape Communications Corporation in _____

A

ECMAScript

1995

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

JavaScript alternate names include:

___________,___________,_________

Microsoft calls their version:

A

Mocha, livescript, JavaScript

Jscript

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

JavaScript is only distantly related to the _______ programming language

The main similarity being its common debt to the ______ programming language

A

Java

C

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What are the 2 ways to write JavaScript in an html document

A

Write JavaScript within a

 element within the <head > element

Write JavaScript within a

 element within the <body> element
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

JavaScript provides ________ methods to manipulate the output stream that represents the browser window

A

four (4)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What are the 4 methods to manipulate output on a browser window

A

1 method: opens wondow
2 methods: writes output in window
1 method: closes window

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

represents the browser window

It is a JavaScript object

A

document

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Methods to open and close a browser window.

A

Open()

Close()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

write a string a character to the browser window It does not generate a \n:

also writes a string of characters to the browser window It automatically generates a \n:

A

write()

writeln()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

is a string containing the HTML markup and text to display in the browser window JavaScript strings are enclosed by “”

A

string

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

However , the \n is not interpreted by a web browser as a newline character If you want to insert a newline in a web page you must use a:

A

<br></br>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

JavaScript provides ______ method to manipulate the output stream that represents a pop -up alert window

A

one (1)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Pop-up Alert Window method

A

window.alert (string )

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

_________ represents a pop-up alert window

It is a JavaScript object similar to _________

A

window

document

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

JavaScript identifiers:

A

Must start with letter, , or $
Can only have letters, digits,
, and $
Cannot be JavaScript reserved word
Also case sensitive

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

JavaScript is a ____________ language !

A

loosely typed

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

JavaScript provides _____ method to obtain input from the user

A

one

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

Method to obtain input for user. method returns the value typed by the user

A

window.prompt (string)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

Logical operators
And
Or
Not

A

&&
||
!

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

Comparison operators

Equal to
Exactly equal to
Not equal too
Not exactly equal too

A

==

!=
!==

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

The _______ statement will break the loop and continue executing the code that follows after the loop (if any).

The __________ statement will break the current loop and continue with the next value.

A

break

continue

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

The _______ statement loops through the elements of an array or through the properties of an object

A

for… in

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
All JavaScript functions return a: The procedure (void return type) concept is not available in JavaScript, but it can be:
value faked
26
Similar to identifiers, JavaScript _______ can be declared, or not, before use The size of any JavaScript array can be resized on the _____, regardless of declared size
arrays fly
27
identifiers can be assigned any primitive data type or object value True False
True
28
array elements cannot be assigned any primitive data type of object value True False
False
29
is an array containing one or more arrays.
multidimensional array
30
To create a two- dimensional array , add each array within its own set of:
curly braces
31
What are arrays with names indexes called?
Associated arrays or hashes This is not allowed in javascript
32
Does JavaScript support arrays with named indexes?
NO
33
In JavaScript , arrays always use ________ indexes
numbered
34
As we have already discussed, the data contained within a HTML form is processed by the program defined by:
action=“”
35
The program resides on a web server and is written in a server-side programming language such as: However JavaScript , is a client -side:
PHP, PERL, etc. PL
36
JavaScript can be used to ensure that a HTML form is properly "_______" before it is submitted
filled out
37
However, data entered into an HTML form can be _________ and _________ by a JavaScript . Additionally, your JavaScript can _______ data into an HTML form input or textarea element. Requires a form ___!
retrieved and processed write Id
38
Each object provides several _________ to allow you to control the __________ and __________ of an object .
methods attributes and behaviors
39
JavaScript provides the _________ object so you can manipulate the document that is currently visible in the browser window.
document
40
JavaScript provides the ________ object so you can manipulate a pop -up alert window .
window
41
JavaScript, like Java, provides many methods to manipulate String objects such as:
charAt() substring() toLowerCase() toUpperCase()
42
JavaScript also provides methods to decorate HTML content, similar to the CSS text -decorate style:
anchor() link() strike() sub() sup() fixed ()
43
JavaScript provides mathematical methods and constants through a ______ object .
Math
44
JavaScript provides the __________ object as an object wrapper for true/false values. They include:
Boolean toString() and valueOf()
45
JavaScript provides the ___________ object as an object wrapper for numeric values . They include:
Number toString() and valueOf()
46
The global ______ property is a value representing Not-A-Number.
NaN
47
Number.isNan ( ) method determines whether a value is: The method returns _______ if the value equates to NaN Otherwise it returns _______.
an illegal number (Not-a-Number). true false
48
JavaScript provides the _________ object so you can manipulate the document that is currently visible in the browser window .
document
49
4 document object methods: 2 document properties:
Methods document.open(); document.write(string_object); document.writeln(string_object); document.close(); Properties document.lastModified document.cookie
50
The __________ property refers to a String object that represents the date and time the document was last modified .
lastModified
51
small amounts of data stored by the web browser . They allow you to store particular information about a user and retrieve it every time they visit your pages.
Cookies
52
The ________________ object property refers to a String object that represents the cookies stored on the user's computer for the current document .
cookie document
53
The five cookie properties:
Name Expires Path Domain Secure
54
Sets cookies name and it’s value Optional value sets date the cookie will expire Optional value specifies path Optional value specifies domain which cookie applies Optional flag indicates browser should use secure sockets later
name=value expires=date path=path domain=domain Secure has no assigned value
55
Defines width different window in pixels. Defines height of window in pixels. Sets how far removed the window appears from the left of the screen in pixels. Partner to left, pushes window off the top of screen. No percentages on all!!!
width=pixel height=pixel left=pixel top=pixel
56
Use this to control whether or not you want the user to be able to resize the window .
resizable= yes or no
57
This lets you decide whether or not to have scrollbars on the window. If your content may be longer then the dimensions you've specified, make sure this is set to yes.
Scrollbars=yes or no
58
Specifies whether the basic back/forward toolbar should be visible. If there are links to follow in your new page , set this to yes .
toolbar=yes or no
59
Specifies whether the location toolbar (address bar) is shown
location= yes or no
60
Specifies whether the directories toolbar is shown (Links toolbar in IE).
directories= yes or no
61
Specifies whether the new window can have a status bar. Best set to yes . For security reasons , Mozilla - based browsers always show the status bar.
status= yes or no
62
Specifies whether the main toolbar ( File, Edit, ...) is shown .
menubar=yes or no
63
Whether or not to copy the old browser window's history list to the new window.
copyhistory= yes or no
64
Netscape 4-only attribute which makes the popup dependent on the status of the main window . If the main window is closed , the popup closes with it.
dependent= yes or no
65
Old Netscape attributes for defining the window's position on the page in pixels. Best to use left and top.
screenX and screenY
66
Internet Explorer- only Boolean attribute which may open the window in fullscreen
fullscreen = yes or no
67
method closes the specified browser window using the name of a specific window object name .
userWindowObject.close()
68
Based on hierarchy, a document is contained within a userWindowObject . To write structure and content in the document contained within a specific window defined by a window object, we use this method
userWindowObject.document.writeln ()
69
If you write structure, content, and/or format to a window , use the following function to signify you've finished writing data to the document .
userWindowObject.document.close ();
70
The properties that can be defined when a window is opened (i.e. location, toolbars, etc.) can be reset after the window has been open.
userWindowObject.property = new_value ;
71
main page style is not carried through pop up. You must write the ______ style information into the popup code if you want style!!!
CSS
72
trigger actions in the browser, like starting a JavaScript when a user clicks on an HTML element or a form button. normally used in combination with functions, and the function will not be executed before the event occurs!
Events
73
DOM stands for:
Document object model
74
DOM is a Platform- and language -neutral interface that will allow programs and scripts to _________________ the content , structure and style of documents
dynamically access and update
75
DOM provides 1. A standard set of ________ for representing HTML and XML documents 2. A standard _________ for accessing and manipulating these documents record
objects interface
76
is an alternative term used by some vendors to describe the combination of HTML, style sheets and scripts that allows documents to be animated
Dynamic HTML
77
is also used to refer to Dynamic HTML
Web 2.0
78
The DOM can be separated into three different parts
1. Core 2. XML 3. HTML
79
defines a standard set of objects for any structured document: defines a standard set of objects for XML documents defines a standard set of objects for HTML documents
Core DOM XML DOM HTML DOM
80
The DOM views HTML documents as a _____ structure of elements All elements , along with their attributes and content (if not empty), can be accessed and manipulated through the DOM _____
tree tree
81
the Document object represents the entire HTML document As with any class object, it has associated _____,_______,______
properties , methods , and arrays
82
There are several __________ Object arrays The name of an array is an: ___________ object arrays are essentially collections" of element objects
Document object Document
83
Because the name of a ___________ Object array is an object, you can access certain properties with the array
Document
84
Returns a reference to all Anchor objects in the document Returns a reference to all Image objects in the document Returns a reference to all Form objects in the document
anchor[] images[] forms[]
85
Returns the date and time the document was last modified
lastModified
86
Specifies the beginning and end of the document body Returns the document server's domain name Sets or returns all cookies associated with the document Returns the URL of the document that loaded the current document Returns the title of the document Returns the URL of the current document
body domain cookie referrer title URL
87
Returns a reference to the first object with the specified id= value Returns a collection of objects (e.g. array ) with the specified name=value Returns a collection of objects (e.g. array) with the specified tagname , where tagname is the actual name of an HTML element
getElementById("value") getElementsByName ("value") getElementsByTagName ("tagname")
88
The "__________" object represents the browser window is created automatically with every instance of a < body> or < frame > element/tag
Window
89
A property that contains the current URL of the window A property that returns the name of the window A property that returns the interior width of the window in pixels A property that returns the interior height of the window in pixels A property that returns the outer width of the window in pixels A property that returns the outer height of the window in pixels
window.location window.name window.innerWidth window.innerHeight window.outerWidth window.outerHeight
90
This object gives you information about an event that has occurred This object represents the state of an event , such as the element in which the event occurred , the state of the keyboard keys , the location of the mouse , and the state of the mouse buttons , etc.
Event
91
The Event object is available only during an: That is, you can use it in __________ but not in ________
event event handlers other code
92
The Style object represents an individual _______ statement. The Style object can be accessed from the __________ or from the ________ to which that style is applied.
style document elements
93
syntax for style using getId:
document.getElementById(“ID”).style.property = “value”;