|
Read Course Text.
Please read and outline section J 2.18 to J 2.60 of your textbook. Pay particular attention
to the numbered orange dots representing each step, the "More
About" side comments, the tan boxes containing code, the tables
and the figures.
|
Module
3.2
Some Window Object Properties:
window,
self, parent,
top, history, location, status
Some Window Object Methods:
alert( ), confirm( ), prompt( ), open( ), close( ), setTimeOut( )
|
Window Object.
Represents the browser window. It is the top-most, global object and
assumed in many statements.
document.write("Hello!")
could be window.document.write("Hello!")
window.alert( ) is a method of the
Window object. Due to the object's global nature, the method could be used
like a function, simply alert( )
Examples:
1. location = "www.cnn.com"
links to a new site.
2. open("webpage.htm",
"window1", "toolbar = no") opens another
window.
3. setTimeOut("Scroller( )",
200) executes Scroller( ) function after 200 milliseconds.
|
Module
3.3
Some
Document Object Properties:
fgColor,
image, cookie,
link, lastModified
Some Document
Object
Methods:
write( ), clear( ), writeln( )
|
Document Object.
Represents the HTML document displayed in the browser. The Document
object's properties provide may details about a web page's text and background
colors as well as the date last modified. The write( ) method of the Document
object is especially useful for dynamically writing HTML to the web page when
it's loading.
Examples:
1. document.fgColor = "yellow"
changes the foreground color to yellow.
2. var CookieInfo = document.cookie
assigns the information stored in a cookie text file to a variable called
CookieInfo.
3. document.write("Last
Modified: " + document.lastModified)
displays the date last modified using the write( ) method.
|
Module
3.4
Some Navigator Object Properties:
appName,
platform, appVersion
Some Navigator
Object
Methods:
javaEnabled( ), preference( )
|
Navigator Object.
Determines which web browser is used to visit the web page. May be used to
direct the user to a customized, browser-specific, web page.
Examples:
1. var BrowserName =
navigator.appName assigns the browser's name (Netscape or
Microsoft Internet Explorer) to a variable called BrowserName.
2. var BrowserVersion =
navigator.appVersion assigns the browser's version () to a
variable called BrowserVersion.
|
Module
3.8
|
Quiz 4. (For those
wanting to finish the course early.)
- What is the top-most or global object in the
JavaScript object hierarchy?
- Identify Branching, Looping and Jumping Control
Statements.
- JavaScript objects and be confusing because some
objects are ________ of other objects.
- Describe Data Types, Variables, Expressions, Operators and Arrays.
- Curly Braces { } are used to hold
________ within the body of a
Function.
|