javascript[objects. Properties] Collection

Source: Internet
Author: User
Tags date format define execution natural logarithm sin square root version
javascript| objects

SCRIPT tag?

Used to include JavaScript code.?

Property?

LANGUAGE define the scripting language?
SRC defines a URL for specifying a file that ends with. js.


Windows object?

Top level object for each HTML document.?

Property?

Frames[] An array of child frames. Each child frame array is stored in the order defined in the source document.
Number of feames.length.?
Self Current window.?
Parent Parents window (the current window is one of the child windows).?
Top top-level window (is the parent window for all visible windows).?
The message on the Status Browser state window.?
Defaultstatus The default message that appears on the Browser status window when status is not valid.
Name Internal name for the window defined by the window.open () method.?

Method?

Alert ("message") Displays the JavaScript Alert dialog box that contains the given message.
Confirm ("message") Displays the "Confirm" dialog box (with an OK button and a Cancel button) that contains the given message. Returns FALSE if the user clicks OK to return true.
Prompt ("message") displays a "Prompt" dialog box that requires the user to give the appropriate input based on the display messages.
Open ("URL", "name") opens a new window, giving a specified name.
Close () Closes the current window.?

Frame object?

It is the child window of the entire browser window, and it owns all the properties of the Window object except the Status,defaultstatus,name property.

Location object?

Contains information about the current URL.?

Property?

href entire URL string.?
Protocol contains the first part of the URL string, such as http:?
The host contains a string with the host name: part of the port number in the URL. Like//www.pclala.com/server/?
Hostname A string containing the host name in the URL. Like http://www.xrss.cn?
Port contains a string of port numbers that may exist in the URL.
Pathname the "/" section in the URL. Like ~list/index.htm?
String after the hash "#" (CGI parameter).
Search "?" String after the number (CGI parameter).?

Document object?

The object that contains the current document information.?

Property?

Title of the current document, if not defined, contains "Untitled".?
Location the full URL of the document.?
LastModified contains the date the document was last modified.
Referrer the caller URL, that is, from which URL the user is linking to the current page.?
bgcolor background color (#xxxxxx)?
Fgcolor foreground text color.?
LinkColor the hyperlink color.?
Vlinkcolor the hyperlink color accessed.?
Alinkcolor Activate chain color (when mouse hold is not placed).
Forms[] An array of form objects in the document, stored in defined order.?
Forms.length the number of form objects in the document.?
Links[] The array object that corresponds to all the href chains in the document, defining the storage in order.?
The number of href chains in the Links.length document.
Anchors[] Anchor (...) Array, defining the storage in order.?
Anchors.length the number of anchors in the document.

Method?

Write ("string") highlights the string to the current window. (Strings can contain HTML tags)?
Writeln ("string"), like write (), appends a carriage return at the end and takes effect only in the intended format text.
Clear () The current window.?
Close () Closes the current window.?

Form object?

Property?

The string value of the name attribute in name.
Class value of Method attribute in method, "0" = "Get", "1" = "POST".?
The string value of the Action property in the action.?
Target table data submission is consistent with the corresponding attribute in the tag.
Elements[index] The Elements property contains the individual elements in the form.
The number of elements in the length table.

Method?

Submit () Submission form.?
Event handler onsubmit () the code that runs when a user clicks a defined button to submit form.?

Text and TextArea objects?

Property?

The string value of the name Name property.?
The string value for the content of the value field.
DefaultValue the initial string value of the field contents.

Method?

Focus () Sets the object input focal point.?
Blur () Removes the input focus from the object.
Select () The input area of the selected object.

Event handler?

onfocus executes when input focus is entered.?
OnBlur executes when the domain loses focus.?
Onselect executes when some text in a field is selected.
OnChange executes when the domain loses focus and the domain value is changed relative to the onfocus execution.

check box (CheckBox) object?

Property?

The string value of the name Name property.?
The string value of the contents of the Value check box. On if set, or off.?
Boolean value for the contents of the Checked check box. True if set, or false.?
defaultchecked reflect (CHECKED) The Boolean value of the property (the default state).

Method?

Click () to select the check box and make it state "on".

Event handler?

OnClick executes when the user clicks the checkbox.?

Radio button (radio) object?

Property?

The string value of the name Name property.?
Length radio The number of radio buttons in the object.
The string value of the value Value property.?
Checked Boolean value, press True, otherwise false.?
Defaultchecked A Boolean value that reflects the value of the checked property.

Method?

Click () Select the Order button.

Event handler?

OnClick executes when the radio button is selected.

Select object?

Property?

The number of objects in the length select object.
Name the internal name of the select object defined by the Name= property.?
SelectedIndex the subscript for the currently selected option in the Select object.?
Options This property corresponds to the contents of the tag when you define a Select object in HTML, and it has the following properties:?
The text string after the text tag.?
Values of the value Value property, which is committed when the submit button is pressed.
Defaultselected A Boolean value that reflects the selected property of the tag.
Selected a Boolean value that reflects the current selection state of option.?

Event handler?

Onfocus executes when the input focus is entered into the domain.?
OnBlur executes when the field loses input focus.?
OnChange executes onChange when the domain loses focus and if the value of the domain changes relative to onfocus execution.

Button object?

There are three types of buttons in the table, defined by the type attribute in the tag:?
. Submit (Type= "Submit")?
. Reset (type= "reset")?
. Custom (type= "button")?

All button objects have the following ingredients:?

Property?

The string value of the value Value property.?
The string value of the name Name property.?

Method?

Click () Select button?

Event handler?

OnClick executes when the button is clicked.?

Submit and Reset objects?

Property?

Value value= the contents of the property.?
The contents of the name Name= property.?

Method?

Click () Select button?

Event handler?

OnClick executes when the button is clicked.?

Password object?

Property?

DefaultValue the contents of the Value= property.
The contents of the name Name= property.?
Value is currently entering data for the password field.?

Method?

Focus () takes you to the password field.?
Blur () removes the focus from the password field.
Select () selects the current data in the Password field for modification.?

Navigator object?

This object is used to determine the navigator version used by the user when accessing.

Property?

appCodeName relative to the user's browser "codename"?
AppName the actual name relative to the user's browser.
AppVersion relative to the user's browser version number.?
UserAgent This property reflects all the information of the user's browser.

String object?

The string object provides a number of ways to manipulate the contents of a string.

Property?

Length string, that is, the number of characters in the string.

Method?

Big (), Blink (), bold (), fixed (), italics (), small (), sub (), Strike (), SUP (), fontcolor (color), fontsize (size)?

The above method adds the appropriate HTML markup for the string.
CharAt (index) returns the character at index in the string.
IndexOf (Searchvalue,[fromindex]) This method searches the string for the first occurrence of the searchvalue. If a fromindex is given, the search starts at that position within the string, and when Searchvalue finds it, Returns the position of the first character of the string.
LastIndexOf (Searchvalue,[fromindex]) searches searchvalue from the tail of the string and reports the first instance found.?
SUBSTRING (INDEXA,INDEXB) gets the substring from indexa to INDEXB.
toLowerCase (), toUpperCase () converts all characters in the string to uppercase and lowercase.

Date object?

To use the Date object, you must be a date instance:?

Variable name =new Date ();?

Method?

Getday (), GetDate (), getHours (), getminutes (), getmonth (), getseconds (), GetTime (), getTimezoneOffset (), getyear ()?

And Setday ...?

toGMTString () returns the current time in GMT format. (sun,12 Feb 1999 14:19:22 GMT)?
toLocaleString returns the current time in locale format. (03/11/99 14:19:22)?
Parse (date) converts the normal date string to a settime (), giving the parameter to the ().

The Math object?

Property?

LN10 (natural logarithm of 10)?
PI (3.1415926 ...)?
Sqrt1_2 (square root of 1/2)?

Method?

ABS (x) returns the absolute value of x?
ACOs (x) returns the arc cosine value of x?
ASIN (x) returns the arc sin value of x?
Atan (x) returns the arc tangent value of x?
Ceil (x) returns the smallest integer greater than or equal to X?
COS (x) returns the cosine value of x?
EXP (x) returns the X-second side of E?
Floor (x) returns the largest integer less than or equal to X?
Log (x) returns x?
Max (x,y) returns a large value in X,y?
MIN (x,y) returns the small value in X,y?
POW (x,y) returns the Y-square of x?
Round (x) rounded to the nearest integer, (less than or equal to 0.5 decimal places)?
Sin (x) returns the sin value of x?
SQRT (x) returns the square root of x?
Tan (x) returns the tangent value of X




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.