BOM model; window (the core of the entire BOM): History, document, location.
BOM can be implemented 1. Pop up a new browser window 2. Move, close, and resize the window 3. Page forward, back
Common Properties: History (attribute name); Information about URLs visited by customers (description)
Location (zodiac name); Information about the current URL (description)
Window. Property value = "attribute value" (URL)
Common methods: Prompt () (method name); Displays a dialog box to prompt the user for input
Alert () (method name); Displays a warning box with a hint message and a OK button
Confirm () (method name); Displays a dialog box with a hint, OK, and Cancel button
Colse (); open (); SetTimeout () invokes the function or evaluates the expression after the specified number of milliseconds, and SetInterval () invokes the function or expression by the specified period (in milliseconds)
Common Events for Window objects
Name |
Description |
OnLoad |
A page or an image is finished loading |
onmouseover |
Move mouse over an element |
Onlick |
The event handle that is invoked when the user clicks on an object |
OnKeyDown |
One of the keyboard keys is pressed |
OnChange |
The contents of the domain are changed |
History Common Objects
Name |
Description |
Back () |
Load the previous URL in the History object list |
Forward () |
Load the next URL in the History object list |
Go () |
Load a specific URL in the History object list |
Common methods for Document objects
getElementById () |
Returns a reference to the first object that owns the specified ID |
Getelementsbyname () |
Returns the collection of objects with the specified name |
getElementsByTagName () |
Returns the collection of objects with the specified label name |
Write () |
Write text, HTML expressions, or JavaScript code to a document |
Checked property value checked: True unchecked: false
Date Object var datetime object =new Date (parameter)
Parameter format: MM DD,YYYY,HH:MM:SS
Object of JavaScript