1. BOM object: Browser object model (manipulating browser-related content)
2. Window Object
Window object represents open windows in the browser
SetInterval (): It has a return value that is primarily provided to clearinterval using
SetTimeout (): It has a return value that is primarily provided to cleartimeout using
Clearinterval (): This method can only clear timed actions set by setinterval
Cleartimeout (): This method can only clear timed actions set by SetTimeout
A few ways to pop up a box:
1 <!DOCTYPE HTML>2 <HTML>3 <Head>4 <MetaCharSet= "UTF-8">5 <title>Window object</title>6 <Script>7 //Warning Box8 Alert ("ah ha! ");9 //Confirm Delete BoxTen Confirm ("are you sure you want to delete it? "); One //Input Box A Prompt ("Please enter the price"); - </Script> - </Head> the <Body> - </Body> - </HTML>
3. History Object
The History object contains the URLs that the user has visited (in a browser window)
Before executing this code, there should be a history page, which can be a hyperlink to this page.
1 <!DOCTYPE HTML>2 <HTML>3 <Head>4 <MetaCharSet= "UTF-8">5 <title>History Object</title>6 <Script>7 functionFanhui () {8 History.go (-1);9 //History.back ();Ten } One </Script> A </Head> - <Body> - <inputtype= "button"value= "Back to previous page"onclick= "Fanhui ()" /> the </Body> - </HTML>
Go (parameters)
Parameters: 1 Returns the previous history page, 2 returns to the previous history page, and 1 goes to the next history page.
3. Location Object
The Location object contains information about the current URL.
1 <!DOCTYPE HTML>2 <HTML>3 <Head>4 <MetaCharSet= "UTF-8">5 <title>Location Object</title>6 </Head>7 <Body>8 <inputtype= "button"value= "Jump to History page"onclick= "javascript:location.href= ' 02_history object. html '"/>9 </Body>Ten </HTML>
JavaScript Learning--bom objects