Test 3 Flashcards

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
Q

All JavaScript functions return a:

The procedure (void return type) concept is not available in JavaScript, but it can be:

A

value

faked

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

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

A

arrays

fly

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

identifiers can be assigned any primitive data type or object value

True
False

A

True

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

array elements cannot be assigned any primitive data type of object value

True
False

A

False

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

is an array containing one or more arrays.

A

multidimensional array

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

To create a two- dimensional array , add each array within its own set of:

A

curly braces

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

What are arrays with names indexes called?

A

Associated arrays or hashes

This is not allowed in javascript

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

Does JavaScript support arrays with named indexes?

A

NO

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

In JavaScript , arrays always use ________ indexes

A

numbered

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

As we have already discussed, the data contained within a HTML form is processed by the program defined by:

A

action=“”

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

The program resides on a web server and is written in a server-side programming language such as:

However JavaScript , is a client -side:

A

PHP, PERL, etc.

PL

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

JavaScript can be used to ensure that a HTML form is properly “_______” before it is submitted

A

filled out

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

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 ___!

A

retrieved and processed

write

Id

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

Each object provides several _________ to allow you to control the __________ and __________ of an object .

A

methods

attributes and behaviors

39
Q

JavaScript provides the _________ object so you can manipulate the document that is currently visible in the browser window.

40
Q

JavaScript provides the ________ object so you can manipulate a pop -up alert window .

41
Q

JavaScript, like Java, provides many methods to manipulate String objects such as:

A

charAt()
substring()
toLowerCase()
toUpperCase()

42
Q

JavaScript also provides methods to decorate HTML content, similar to the CSS text -decorate style:

A

anchor()
link()
strike()
sub()
sup()
fixed ()

43
Q

JavaScript provides mathematical methods and constants through a ______ object .

44
Q

JavaScript provides the __________ object as an object wrapper for true/false values.

They include:

A

Boolean

toString() and valueOf()

45
Q

JavaScript provides the ___________ object as an object wrapper for numeric values .

They include:

A

Number

toString() and valueOf()

46
Q

The global ______ property is a value representing Not-A-Number.

47
Q

Number.isNan ( ) method determines whether a value is:

The method returns _______ if the value equates to NaN Otherwise it returns _______.

A

an illegal number (Not-a-Number).

true
false

48
Q

JavaScript provides the _________ object so you can manipulate the document that is currently visible in the browser window .

49
Q

4 document object methods:

2 document properties:

A

Methods
document.open();
document.write(string_object);
document.writeln(string_object);
document.close();

Properties
document.lastModified
document.cookie

50
Q

The __________ property refers to a String object that represents the date and time the document was last modified .

A

lastModified

51
Q

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.

52
Q

The ________________ object property refers to a String object that represents the cookies stored on the user’s computer for the current document .

A

cookie document

53
Q

The five cookie properties:

A

Name
Expires
Path
Domain
Secure

54
Q

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

A

name=value

expires=date

path=path

domain=domain

Secure has no assigned value

55
Q

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!!!

A

width=pixel
height=pixel

left=pixel
top=pixel

56
Q

Use this to control whether or not you want the user to be able to resize the window .

A

resizable= yes or no

57
Q

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.

A

Scrollbars=yes or no

58
Q

Specifies whether the basic back/forward toolbar should be visible.

If there are links to follow in your new page , set this to yes .

A

toolbar=yes or no

59
Q

Specifies whether the location toolbar (address bar) is shown

A

location= yes or no

60
Q

Specifies whether the directories toolbar is shown (Links toolbar in IE).

A

directories= yes or no

61
Q

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.

A

status= yes or no

62
Q

Specifies whether the main toolbar ( File, Edit, …) is shown .

A

menubar=yes or no

63
Q

Whether or not to copy the old browser window’s history list to the new window.

A

copyhistory= yes or no

64
Q

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.

A

dependent= yes or no

65
Q

Old Netscape attributes for defining the window’s position on the page in pixels.

Best to use left and top.

A

screenX and screenY

66
Q

Internet Explorer- only Boolean attribute which may open the window in fullscreen

A

fullscreen = yes or no

67
Q

method closes the specified browser window using the name of a specific window object name .

A

userWindowObject.close()

68
Q

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

A

userWindowObject.document.writeln ()

69
Q

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 .

A

userWindowObject.document.close ();

70
Q

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.

A

userWindowObject.property = new_value ;

71
Q

main page style is not carried through pop up.

You must write the ______ style information into the popup code if you want style!!!

72
Q

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!

73
Q

DOM stands for:

A

Document object model

74
Q

DOM is a Platform- and language -neutral interface that will allow programs and scripts to _________________ the content , structure and style of documents

A

dynamically access and update

75
Q

DOM provides

  1. A standard set of ________ for representing HTML and XML documents
  2. A standard _________ for accessing and manipulating these documents record
A

objects

interface

76
Q

is an alternative term used by some vendors to describe the combination of HTML, style sheets and scripts that allows documents to be animated

A

Dynamic HTML

77
Q

is also used to refer to Dynamic HTML

78
Q

The DOM can be separated into three different parts

A
  1. Core
  2. XML
  3. HTML
79
Q

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

A

Core DOM
XML DOM
HTML DOM

80
Q

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 _____

81
Q

the Document object represents the entire HTML document

As with any class object, it has associated _____,_______,______

A

properties , methods , and arrays

82
Q

There are several __________ Object arrays

The name of an array is an:

___________ object arrays are essentially collections” of element objects

A

Document

object

Document

83
Q

Because the name of a ___________ Object array is an object, you can access certain properties with the array

84
Q

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

A

anchor[]
images[]
forms[]

85
Q

Returns the date and time the document was last modified

A

lastModified

86
Q

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

A

body

domain

cookie

referrer

title

URL

87
Q

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

A

getElementById(“value”)

getElementsByName (“value”)

getElementsByTagName (“tagname”)

88
Q

The “__________” object represents the browser window

is created automatically with every instance of a < body> or < frame > element/tag

89
Q

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

A

window.location

window.name

window.innerWidth

window.innerHeight

window.outerWidth

window.outerHeight

90
Q

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.

91
Q

The Event object is available only during an:

That is, you can use it in __________ but not in ________

A

event

event handlers
other code

92
Q

The Style object represents an individual _______ statement.

The Style object can be accessed from the __________ or from the ________ to which that style is applied.

A

style

document
elements

93
Q

syntax for style using getId:

A

document.getElementById(“ID”).style.property = “value”;