JavaScript, Friday, March 30 and April 6, 2001, 4-7PM
Northern Virginia Community College, Alexandria
Community, Corporate and Workforce Development
William M. Pegram, Instructor, williampegram@erols.com
http://www.erols.com/wpegram
- Uses of JavaScript
- Client-side vs. Server-side JavaScript
- <Script> tags to put JavaScript in Web Pages, language attribute
- JavaScript coding - case sensitive, use of semicolons, comments
- User Input and Displaying Results (alert, confirm, prompt, variables,
document.write)
- Error Messages in IE and Netscape
Exercise - using prompt to get user input and then document.write to display
it in web page
- "Core JavaScript"
Strings
Arrays
Conditional statements - if, use == rather than =
Date Object, toLocaleString, getDate, getMonth, getFullYear methods
Exercise - (1) display date and time in default format, (2) display date and
time in Month Day, Four Digit Year format (for example March 30, 2001) using
(a) Date methods, if statements, document.write, (b) Date Methods, arrays,
and document.write, or (c) Date methods, switch statement,
document.write
Functions - often defined in <head></head>, called from
<body></body>
- Window Object - window.alert, window.confirm, window.prompt, window.open
- Document Object - lastModified
- Navigator Object - appName, appVersion, string methods (part of core
JavaScript) parseInt(s), parseFloat(s), string.indexOf(substring)
Exercise - browser detection using these methods and if statement
- Using JavaScript to Respond to Events
-Calculations in Forms - exercise
-Using Form Input to Jump to another page using window.location - exercise
-Image Replacement - exercise
- Language
- Examples (displaying
date, image rollovers, drop down box to jump to new page, changing page
color dynamically, popup windows, image rotation)
- More Examples (Date
methods, drop down box to jump to new page, drop down box to change contents
of another drop down box, form verification methods)
- Additional
Language Statements
- Books