Windows-represents an open window in the browser:
Object Properties
Window//Windows themselves
Window.self//cite this window window=window.self
Window.name//Name the window
Window.defaultstatus//Setting window status bar information
Window.location//url address, equipped with this property to open a new page
Object methods
Window.alert ("text")//Prompt Message session box
Window.confirm ("text")//Confirm session Box
Window.prompt ("text")//Require keyboard input session box
Window.setintervel ("Action", Time)//The operation is performed once every interval specified (in milliseconds)
Window.clearinterval ()//clear time equipped with the function is to terminate the cycle
Window.settimeout (action,time)//Interval of time (milliseconds) to perform an operation
window.open ()//Open a new window
Window.close ()//Close window
member Objects
Window.event
Window.document//See Document Object detailed
Window.history
Window.screen
Window.navigator
window.external
-------------------------------------------------- -------------------
Window.history Object
Window.history.length//Number of pages viewed
History.back ()//back
History.forward ()//forward
History.go (i)//forward or rewind to the first page of the history record
I>0 Progress, i<0 back
------------------------------------------------- -------------------
Window.screen Object
Window.screen.width//Screen width
Window.screen.height//Screen height
Window.screen.colorDepth//Screen color depth
Window.screen.availWidth//Available width
Window.screen.availHeight//Available height (drop taskbar height)
-------------------------------------------------- -------------------
Window.External Object
Window.external.AddFavorite ("Address", "title")//Add the website to the Preservation folder
-------------------------------------------------- -------------------
Window.navigator Object
Window.navigator.appCodeName//Browser code name
Window.navigator.appName//Browser application name
Window.navigator.appMinorVersion//Browser patch version
Window.navigator.cpuClass//CPU Type x86
Window.navigator.platform//Operating system type Win32
Window.navigator.plugins
Window.navigator.opsProfile
Window.navigator.userProfile
Window.navigator.systemLanguage//Customer System language ZH-CN Simplified Chinese
Window.navigator.userLanguage//user language, ibid.
Window.navigator.appVersion//Browser version
Window.navigator.userAgent
Window.navigator.onLine//user no online
window.navigator.cookieEnabled//Browser supports cookies
Window.navigator.mimeTypes
The Document object--representing the entire HTML document, can be used to access all the elements in the page:
Object Properties
Document.title//Set document title equivalent to HTML <title> tags
Document.bgcolor//Set page background color
Document.fgcolor//Set foreground (text color)
Document.linkcolor//non-clicked link color
Document.alinkcolor//Activate link (focus on this link) color
Document.vlinkcolor//Clicked link color
Document. URL//Set URL property to open another page in the same window
Document.filecreateddate//File creation date, read-only property
Document.filemodifieddate//File modification date, read-only property
Document.filesize//File size, read-only property
Document.cookie//Set up and read out cookies
Document.charset//Set character sets Simplified Chinese: gb2312
Common Object Methods
document.write ()//write content to page dynamically
Document.createelement (tag)//Create an HTML tag object
document.getElementById (ID)//Get the object with the specified ID value
Document.getelementsbyname (name)//Gets the object with the specified Name value
Document.body.appendChild (Otag)
body-Principal Sub-object
Document.body//Specifies the beginning and end of a document body equivalent to <body></body>
Document.body.bgColor//Sets or gets the background color behind the object
Document.body.link//non-clicked link color
Document.body.alink//Activate link (focus on this link) color
Document.body.vlink//Clicked link color
Document.body.text//Text color
Document.body.innerText//Set text between <body>...</body>
Document.body.innerHTML//settings <body>...</body> HTML code between
Document.body.topMargin//page top margin
Document.body.leftMargin//Page left margin
Document.body.rightMargin//Page right margin
Document.body.bottomMargin//Page Bottom margin
Document.body.background//Background image
Document.body.appendChild (Otag)//dynamically generate an HTML object
Common Object Events
document.body.onclick= "func ()"//mouse pointer Click object is triggered
Document.body.onmouseover= "func ()"//mouse pointer is triggered when moving to an object
Document.body.onmouseout= "func ()"///mouse pointer is triggered when the object is moved out
location-Position Sub-object
Document.location.hash//#号后的部分
Document.location.host//domain + port number
Document.location.hostname//Domain name
Document.location.href//Full URL
Document.location.pathname//directory section
Document.location.port//Port number
Document.location.protocol//Network Protocol (http:)
Section after Document.location.search//?
Common Object Events
Documeny.location.reload ()//Refresh Web page
Document.location.reload (URL)//Open a new page
Document.location.assign (URL)//Open a new page
Document.location.replace (URL)//Open a new page
========================================================================
selection-Selection Sub-object
Document.selection
========================================================================
Images collection (images in the page):
----------------------------
A) by collection reference
Document.images// tags on the corresponding page
Document.images.length//number of tags on the corresponding page
Document.images[0]//1th tags
Document.images[i]//i-1 tags
----------------------------
b) direct reference via Nane property
Document.images.oImage//document.images.name Properties
----------------------------
c) The SRC attribute of the reference picture
Document.images.oImage.src//document.images.name property. src
The Window object and document object in HTML