Web Engineering
Hassan Khan
JavaScript Events
Events are actions that can be detected by
JavaScript.
Examples of events:
A mouse click
A web page or an image loading
Mousing over a hot spot on the web page
Selecting an input field in an HTML form
Submitting an HTML form
A keystroke
8/9/2010 Hassan Khan 33
Events
onLoad and onUnload
onFocus, onBlur and onChange
onSubmit
onMouseOver and onMouseOut
8/9/2010 Hassan Khan 34
JavaScript Objects
JavaScript is an Object Oriented
Programming (OOP) language.
An OOP language allows you to define your
own objects and make your own variable
types.
We will start by looking at the built-in
JavaScript objects.
8/9/2010 Hassan Khan 35
JavaScript Objects and Properties
Properties are the values associated with an
object.
8/9/2010 Hassan Khan 36
JavaScript String Object
The String object is used to manipulate a
stored piece of text.
Some String Methods
search()
toLowerCase()
toUpperCase()
8/9/2010 Hassan Khan 37
JavaScript Date Object
The Date object is used to work with dates
and times.
8/9/2010 Hassan Khan 38
Data Comparison
8/9/2010 Hassan Khan 39
JavaScript Array Object
The Array object is used to store multiple
values in a single variable.
An array can be defined in three ways.
8/9/2010 Hassan Khan 40
JavaScript Math Object
The Math object allows you to perform
mathematical tasks.
Math.PI
Math.E
Math.sqrt(number)
Math.round(4.7)
8/9/2010 Hassan Khan 41
JavaScript Navigator Object
The Navigator object allows you to
check/validate your Browser.
Navigator.appName,;
Navigator.appVersion
8/9/2010 Hassan Khan 42