Web Technologies Class
Javascript
Alert boxes ("Hello, cruel world.")
Strings
As variables
document.write
Operations on strings and String.methods()
String addition
myString.split("split string")
Array Declaration
Array Usage
myString.replace(/newString/gi,bigOldString)
myString.indexOf(potentialSubString)
index if found
-1 if not
Bizarro indexOf() -- lastIndexOf()
myString.slice(beginIndex)
OR
.slice(beginIndex, endIndex)
myString.length; //
property alert!
(not a method)
myString.charAt(index);
myString.charCodeAt(index);
myString.fromCharCode(index1,index2.index3);
Late entry --
the Image Swap
Math
Ints
Operations
+,-,*./ (
aka
: Add, subtract, multiply and divide )
% or Modulus (Who made THAT word up?)
Float and Conversions (from string to numeric)
parseFloat(myString);
if (isNaN(parseFloat(myString))) {...
Form
Elements
Radio 1
Radio 2
Check Box 1
Check Box 2
This is our textarea. Still our text area. Weird, eh? Kinda like PRE tags.
Submittals
"Query Strings"
location.search
DOMs (document.form[].elements[].value)
Events
onClick
onMouseOver
onMouseOut
onChange
onSubmit (see D2, above)
focus
Browser Checks
Through DOMs (Document Object Hierarchies)
document.layers vs.
document.all
Through variables
navigator.appCodeName
navigator.appName
navigator.appVersion
navigator.userAgent
Moving trucks
Objects not appearing in this film
Confirm
Prompt
Frames (and their parents and DOMs)
Cascading Style Sheets (CSS)
Declaring
In individual elements
At top of page
Through includes
Overriding
Objects/Properties
color
text-decoration
border
font-family
font-size
Dynamic HTML (DHTML)
Using the SPAN and DIV tags
Accessing CSS values through the browser-specific DOMs
Useful Properties for DHTML
visibility
absolute position
Javascript functions for DHTML
Webmonkey -- CSS tutorial
Javascript R eference from Netscape (beware the layer!).
Plain Jane HTML tag ref.