Академический Документы
Профессиональный Документы
Культура Документы
Browser Object
When a JavaScript enabled browser loads a
web page, the browser automatically creates a number of JavaScript objects that map to the DOM.
It is the DOM which provide JavaScript access
Object Hierarchy
Navigator Plugin MimeType
Window Frame
History Anchor Applet Embed Document Form Location Layer Link Area
Image
Button Checkbox
FileUpload Hidden
Password Radio
Reset Submit
Select
Text Textarea
Option
JavaScript Objects
Object Name Its use To access information about the browser that is executing current script. To access a browser or a frame within the window. To access the document currently loaded into a window. To represent a URL. It can be used to create a URL object, access parts of a URL, or modify an existing URL. To maintain a history of the URLS accessed within a window.
Location
History
Event
4
How a JavaScript enabled browser handles the Documents object. Any document (html page) can contain various HTML object such as
Images Image Maps Hyperlinks Frames Anchors Applets Multimedia objects such a audio files, streaming video files. A form with various form elements.
Browser creates one array in memory per HTML object in the document, thus registering each of these HTML objects.
if these HTML objects are actually contained in the HTML page then these arrays will hold indexed elements. Otherwise the array will exist, but will be empty.
Checkbox
Button Submit
Reset
Select Option Password Hidden fileupload
onError
onFocus onKeyDown onKeyPress
onKeyUp
onLoad onMouseDown
Properties
Name Value
Methods
Events
JavaScript provides the following event handler for the text objects event
10
Properties
Name Value
Methods
Events
JavaScript provides the following event handler for the password objects event
11
Methods
Click()
Events
Click()
objects event.
onClick()
Syntax:
Methods
Click()
Events
Click()
Syntax:
Methods
Click()
Events
Click()
Syntax: <input type=reset name=name of object value=buttonLabel> <input type=reset name=btnCheck value=Verify>
14
Methods
Click()
Events
Click()
Syntax: <input type=checkbox name=name of object value=yes or no checked> <input type=checkbox name=employed value=Yes checked>
15
onClicked()
Syntax: <input type=radio name=RadioGroupName value=1 checked> <input type=radio name=numbers value=1 >1<br> <input type=radio name=numbers value=2 >2<br>
16
Properties
Name Value focus() blur() select() focus() blur() select() onFocus() onBlur() onSelect()
Methods
Events
Syntax: < textarea name=MyTextArea Row=10 COLS=25 > <h3> Enter Data Here </h3> </textarea>
17
Properties
Name Value selectedIndex Selected Text value focus() blur() Change() focus() blur() Change() onFocus() onBlur() onChange()
Methods
Events
18
Object Referencing
A fully-qualified reference:
window.document.myForm.myButton.value
window (often suppressed) and document are predefined objects myForm and myButton are user-defined object names value is a property of the Button object (and most other form elements)
19