JavaScript object and Array reference Daquan

Source: Internet
Author: User
Tags italic font mathematical constants gopher natural logarithm

Http://www.cnblogs.com/meil/archive/2006/06/28/437527.html This article lists various JavaScript objects and arrays, including a short description of the work done by each of these objects or arrays. As well as its associated property methods, as well as the event handlers, which also indicate that the parent object of the object or array may also need to refer to the Super-text object Hierarchy page in online companion (HTTP/ www.netscapepress.com/support/javascript/10-9.htm) in order to understand how these objects relate to one another.
By the way, remember that all objects that are sub-objects of another object are considered to be properties of the object, see the annotations in chapter tenth that relate to this.

B.1 Anchor Object
HTML strokes created with the <a name=> tag can be targeted by a link if the anchor includes a href= attribute, it is also a linked object.
The Anchor object is a property of the Document object, which itself does not have a property method or an event handler.

B.2 Anchors Array
The anchors array is a property of the document object and is a list of all the anchor objects within the documents if anchor is also a link, it appears in both the anchors and links arrays.
Property
Number of anchor points in length document

B.3 Array Object
The array object is a new object introduced in Netscape Navlgator 3.0 Beta 3, so it cannot be used in Netscape 2.0 because it is a built-in object, not a property of another object.
Property
The number of values in the length array

B.4 Button Object
It is a property of the form object and is created using the <input type= "button" > tag.
Property
The Name= attribute in the name HTML tag
The value= attribute in the value HTML tag
Method
Click a button to simulate mouse clicks
Event handlers
Onclick

B.5 CheckBox Object
It is a property of the form object and is created using the <input type= "checkbox" > tag.
Property
Checked the selection state of the check box
checked= Characteristics of defaultchecked Markers
The name= attribute of the name tag
The value= attribute of the value tag
Method
Click the analog mouse button
Event handlers
OnClick

B.6 Date Object
It is a built-in object-not a property of other objects, allowing the user to perform various processes that use the date and time.
Method
GetDate () To view the Date object and return the dates
GetDay () Return day of the week
GetHours () returns the number of hours
Getminutes () returns the number of minutes
GetMonth () returns the month value
Getseconds () returns the number of seconds
GetTime () returns the full time
getTimezoneOffset () Returns the time zone bias value (the number of hours between Greenwich Mean time and the time zone setting of the computer where the script is running)
GetYear () return year
Parse () returns the number of milliseconds since January 1, 1970 00:00:00 in the date string (the Date object is stored as a number of milliseconds from then on) but note that the method is not currently running correctly
SetDate () Date object changed
Sethours () Change the number of hours
Setminutes () Change the number of minutes
Setmonth () Change month
Setseconds () Change the number of seconds
SetTime () Change the full time
Setyear () Change year
toGMTString () Turns the Date object's Day (a numeric value) into a GMT-time string, returning a value similar to the following: weds,15 June l997 14:02:02 GMT (exact format depends on the operating system running on the computer)
toLocaleString () Turns the Date object's dates (a numeric value) into a string, using the specific date format used on the computer on which it is configured
UTC () uses date UTC (Year, month, day, time, minute, second) to return the date as a number of milliseconds since January 1, 1970 00:00:00 (where hours, minutes, seconds are optional)

B.7 Document Object
This object is a property of the window and the Frames object and is a document that is displayed in the Windows or frame.
Property
Alinkcolor Color of active links (ALINK)
Anchor a HTMI anchor point, created with the <a name=> tag (the property itself is an object)
Anchors array lists the arrays of the document anchor objects (<a name=>) (the property itself is an object)
BgColor Background color of document (BgColor)
A piece of information stored in a cookie.txt file by a cookie, which is a property of the Document object
Fgcolor the text color of the document (the text attribute in the <BODY> tag)
A form (<FORM>) in the form document (the property itself is an object)
Forms Anay lists an array of form objects in the order in which they appear in the document (the property itself is an object as well)
LastModified Last modified date of document
LinkColor the link color of the document, that is, the link attribute in the <BODY> tag (linked to a document not observed by the user)
A <a href=> tag in the link document (the property itself is also an object)
Links an array of link objects in an array document, arranged in the order in which they appear in the document (the property itself is an object)
Location currently displays the URL of the document. The user cannot change the document.location (because this is where the document is currently displayed). However, you can change window.location (replace the current document with another document) window.location itself is an object, and Document.location is not an object
Referrer contains the URL of the linked document, which the user clicks to reach the current document
Title of the title document ((title>)
Vlinkcolor a link text color that points to a document that the user has observed, that is, the Vlink attribute of the <BODY> tag
Method
Clear clears the contents of the specified document
Close Document Flow
Open Document Flow
Write writes text to a document
Writeln writes text to the document and ends with a newline character

B.8 Elements Array
It is a property of the form object that lists an array of elements within the form.
Properties
The number of elements in the 1ength window
b.9 Form Object
It is a property of the Document object, a form within the documentation. The
Properties
Action contains a string for the target URL that is submitted for a form
a button inside the button window, using the <input type= "button" > tag to create (the property itself is an object)
Check Box checkbox, using <input type= "checkbox" > tag to create (the property itself is an object)
elements an array that enumerates the form elements in the order in which they appear in the window (the property itself is an object)
Encoding the MIME encoding of the form
  a hidden element in the hidden form (<input type= "hidden" >). A property of the form object (the property itself is also an object) the number of elements in the
length form
method in which the data from the input form is transferred to the server, that is, the method attribute in the (form) tag
Radio the radio button set in the form (& Lt;input type= "RADIO" >) (the property itself is an object) the Reset button in the
Reset form ((1NPUT type= "reset" >) (the property itself is an object)
Select box ( <SELECT>) (the property itself is an object) the Submit button in the
Submit form (<input type= "Submit" >) (the property itself is an object)
when the target submits the form, The name of the window that displays the response information
The text element (<input type= "text" >) in the Text form (the property itself is also an object)
Textarta the Textual Area element (<TEXTAREA>) in the form ( The property itself is also an object)
Method
Submit form (same as using the Submit button) event handler
OnSubmit

b.10 Forms Array
The array is a property of the Document object, which lists an array of forms within the documents.
Property
Number of forms within the length document

B.11 Frame Object
It is a property of the Window object, and a frame within it. In addition to the individual exceptions, the frame object works the same as the Window object.
Property
Frames array lists an array of the various sub-frames within the framework (the property itself is also an object)
Length The number of frames within the frame
Name of the frame (name attribute in the <FRAME> tag)
Parent contains synonyms for this frame's parents window
Self the synonym of the current frame
Synonyms for window's current frame
Method
Cleartimeout () Work to terminate the SetTimeout method
SetTimeout () waits for the specified number of milliseconds and then runs the instruction

b.12 Frames Array
It is both a Window object and a property of a Frame object, and lists the frames within a window or frame object.
Property
Number of frames within the length window or frame object

B.13 Hidden Object
Paste is a property of the form object, a hidden element in the body (<input type= "HIDDEN" >).
Property
Name within the name tag (name attribute)
The value= attribute within the value tag

B.14 History Object
It is a property of the Window object, which is a historical list of the Windows.
Property
Number of items in the length history list
Method
Back to load the previous document in the history list
Forward loading the next document in the history list
A specified document in the Go Load History list, specified by the position of the document in the list

B.15 Image Object
It is a property of the Document object and is an image embedded in the document using the (1MG) tag. This is a new object introduced by Netscape Navigator 3.0 Beta 3.
Property
Border characteristics of border markers
Complete indicates whether the browser has completely loaded a Boolean value of the image
Height height characteristics
Hspace hspace Characteristics
LOWSRC LOWSRC Characteristics
SRC SRC Properties
Vspace vspace Characteristics
Width Width Property
Event handlers
Onload Image Loading
Onerror Loading Error
Onabort Cancel

b.16 Images Array
It is a property of the Document object, and a list of all the images in it.
Property
Number of images in length document

b.17 Link
It is a property of the Document object, one of the <a href=> tags within the documentation.
Property
A string that begins with a hash number (#) to specify an anchor point within the URL
Host name portion of the URL for host including colon and port number
Hostname is the same as the host property except for colons and port numbers
href full URL
The directory path portion of the pathname URL
Port URL: Ports section
Protocol URL type (http:, ftp:, Gopher: etc.)
Search a part of a URL that starts with a question mark to specify searching information
Target the window used to display the contents of the referenced document when the user clicks a link (target attribute)
Event handlers
Onclick Click
Onmouseover mouse pointer over the object

B.18 Links Array
It is a property of the Document object, and a list of all links within it.
Property
Number of links in length document

B.19 Location Object
It is a property of the Document object, which is the full URL, do not confuse it with the Window.location property, which can be used to load a new document. And the Window.location property itself is not an object, while window.location can be modified with a script, and document.location cannot.
Property
Hash A string that begins with a hash number (#) to specify an anchor point within the URL
Host name part of the URL that contains the colon and port number
hostname is the same as host property except that the colon and port number are not included in the
H Ref full URL
Pathname URL of directory path part
Port URL: Port Part
protocol type of URL (http:, ftp:, Gopher: etc)
Search with question mark (?) A portion of the starting URL that specifies the search information
when the target user clicks the link (target attribute), the window used to display the contents of the referenced document

B.20 Math Object
The object is not a property of other objects, but rather a built-in object that contains many mathematical constants and functions.
Property
E Euler constant, natural logarithm of the base (approximately equal to 2.718)
LN2 2 natural logarithm (approximately equal to 0.693)
LN10 10 natural logarithm (approximately equals 2.302)
log2e logarithm of E of 2 (approximately equal to 1.442)
LOG10E The value of the logarithm (approximately equal to o.434)
Pi∏ of E of 10 (approximately equal to 3.14159)
Sqrt1_2 0.5 squared root (i.e. l divided by 2 squared root, approximately o.707)
SQRT2 2 square root (approximately equal to 1.4  
Method
Abs () returns the absolute value of a number (that is, the distance between the number and O, for example, the absolute value of 2 and 12 is 2)
ACOs () returns the inverse cosine of a number (in radians)
ASIN () returns the inverse sine of a number (in radians)
Atan () returns the inverse tangent of a number (in radians)
Ceil () returns the smallest integer equal to or greater than the number (Ceil (-22.22) returns -22;CEIL22,22) return 23;ceil (22) return ()
cos () Returns the cosine of a number (in radians)
exp () returns EN
floor () opposite to ceil (floor (22.22) returns a 23;floor (22.22) to return to; Floor (22) return)
10g () Returns the natural logarithm of a number (base e)
Max () returns a large value between two numbers
min () returns a small value of two questions
Pow () returns the N-square of M (where M is the base, n is exponential)
random () returns a pseudo-random number between 0 and 1 (the method Only valid in Unix versions of Netscape
Navigator)
Round () returns a number rounded to the integer
Sin () returns the sine of a number (in radians)
sqrt () returns the square root of a number
tan ( ) returns the tangent of a number

B.2L Navigator Object
The object is not a property of another object, but rather a built-in object that contains information about the browser that loads the document.
Property
appCodeName the code name of the browser (for example, Mozilla)
AppName the name of the browser
AppVersion version number of the browser
useragent user and Proxy header text sent by the client to the server
Method
This method is not currently available in javaenabled JavaScript, but will be added shortly after it will see if the browser is a JavaScript-compatible browser, and if so, continue to see if JavaScript is in a supported state.

b.22 Options Array
The array is a property of the Select object, which is a list of all the options (<OPTION>) in the selection box.
Property
defaultselected default options in the list of options
Index position of an option in the Index options list
Number of options in the Length options list (<OPTIONS>)
Name option List names (name attribute)
Selected Represents a Boolean type value for an option in the list of options <OPTION> whether it is selected
Index of <OPTION> selected in the SelectedIndex Options list (location)
Text in the text options list <OPTION> tagged
The value= attribute in the Value options list

B.23 Password Object
It is a property of the Document object, a <input type= "PASSWORD" > tag.
Property
DefaultValue default value of password object (value= attribute)
Name of the object (Name= attribute)
Value This field has the same current value as the value= attribute (Defauttvalue) initially, but if the script modifies the value in that field, the value will change
Method
Focus moves away from the field
Blur move focus to the field
Select Input Area

B.24 Radio Object
It is a property of the Form object, a group of radio buttons (option buttons) in the body (<input type= "RADIO" >).
Property
Checked the status of a check box or option button (radio button)
Defaultchecked the default state of a check box or option button (radio button)
Length The number of buttons in a group of radio buttons
Name of the object (Name= attribute)
Value Value= Property
Method
Click the analog mouse button
Event handlers
OnClick Click

b.25 Reset Object
It is a property of the form object, the Reset button (<input type= "reset" >).
Property
Name of the object (Name= attribute)
Value Value= Property
Method
Click the analog mouse button
Event handlers
OnClick Click

b.26 Select Object
It is a property of the Form object, the selection box (<SELECT>).
Property
Number of options in the Length options list (<OPTIONS>)
Name option List names (name attribute)
Number of options in option list
Index of <OPTION> selected in the Selectedlndex Options list (location)
Text after the (option) tag in the Text options list
The value= attribute in the Value options list
Method
Blur remove focus from the list of options
Focus moves to the list of options
Event handlers
Onblur event when losing focus
onchange Change
Onfocus Spotlight Event

B.27 String Object
It is not a property of another object, but a built-in object, that is, a string of character strings entered in the script must be enclosed in quotation marks.
Property
The number of characters in the length string
Method
anchor () is used to convert the string into an HTML anchor tag (<a name=>)
Big () to turn the text in the string into a large font (<big& gt;)
Blink () changes the text in the string to a blinking font (<BLINK>)
Bold () turns the text in the string into a black font (<B>)
CharAt () looks for a character in the specified position in the string
F Ixed () turns the text in the string into a fixed-spacing font (<TT>)
FontColor () changes the color of the text in the string (<font color=>)
FontSize () turns the text in the string to the specified size ( <FONTSIZE=>)
IndexOf () searches for a special character in a string and returns the index position of the character
italics () changes the text in the string to italic font (<I>)
Lastlndexof () is similar to indexof, but searches backwards for the last occurrence of the character
Link () is used to convert a string into an HTML link tag (<a href=>)
Small () to turn the text in the string into a small font (<SMALL>
Strike () turns the text in the string into a crossed-out font (<STRIKE>)
Sub () to turn the text in the string into a subscript (subscript) font ((sub>)
substring ()  Returns a portion of a string between the specified positions
Sup () turns the text in the string into a superscript (superscript) font (<SUP>)
toLowerCase () turns the text in the string into lowercase
toUpperCase () turns the text in the string to uppercase

b.28 Submit Object
It is a property of the Form object, one of the Submit buttons (<input type= "Submit" >).
Property
Name of the object (Name= attribute)
Value Value= Property
Method
Click the analog mouse button
Event handlers
Onclick Click

B.29 text Object
It is a property of the Form object, a text field in the Cosmic body (<input type= "text" >).
Property
DefaultValue default value for text object (value= attribute)
Name of the object (Name= attribute)
Value This field has the current value, originally the same as the value= attribute (defaultvalue) However, if the script modifies the value in the field, the value changes
Method
Blur move focus away from the text box
Focus moves to the text box
Select Input Area
Event handlers
Onblur Lost Focus Event
Onchange Change
Onfocus Spotlight Event
Onselect Selecting events

b.30 TextArea Object
It is a property of the Form object, a text area (<TEXTAREA>) in the Cosmos body.
Property
DefaultValue default value of textarea object (value= attribute)
Name of the object (Name= attribute)
Value This field has the current value, initially the same as the value= attribute (defaultvalue), but if the script modifies the value in the field, the value will change.
Method
Blur the focus away from the text area
Focus moves to the text area
Select Choose Input Area event handler
Event handlers
Onblur Lost Focus Event
Onchange Change
Onfocus Spotlight Event
Onselect Selecting events

b.31 Window Object
It is a top-level object, not another object's property that is the browser's window.
Property
Defaultstatus The default status bar message
Document currently displayed (the property itself is an object)
A frame in the frame window ((frame>) (the property itself is an object)
Frames array that lists the frame objects of the window, listed in the order in which they appear in the document (the property itself is an object)
Historical list of history windows (the property itself is also an object)
Number of frames within the length window
The full (absolute) URL of the document displayed by the Location window (the property itself is an object) do not confuse it with document.location, which is the URL of the currently displayed document. The user can change window.location (replace the current document with another document), but cannot change document.location (because this is where the document is currently displayed)
When the name window opens, give the name of the window
Opener represents the window in which the script that opens the current window with window.open (this is a new attribute introduced by Netscape Navigator 3.0beta 3)
Parent contains a synonym for the window of the current frame. A property of the frame and window objects
Self the synonym of the current window or frame
The message in the status bar
Top contains synonyms for the topmost browser window of the current frame
A synonym for the window or frame that is the same as self
Method
Alert () Open an alert message box
Cleartimeout () Work to terminate the SetTimeout method
Close () Closes the window
Confirm () Opens a Confirm message box, the user can select OK or cancel, if the user clicks OK, the method returns True, click Cancel to return False
Blur () Moves the focus away from the specified window (this is the new method introduced by Netscape Navigator 3.0 Beta 3)
Focus () Bring the specified window to the foreground (another new method)
Open () Opens a new window
Prompt () Opens a prompt dialog box where the user can type text into the box and return the typed text to the script
SetTimeout () waits a specified number of milliseconds and then runs the instruction event handler
Event handlers
Onload () trigger on page load
Onunload () triggered when the page is closed

JavaScript object and Array reference Daquan

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.