javascript| objects
SCRIPT tag
Used to include JavaScript code.
Grammar
Property
LANGUAGE Definition scripting language
SRC defines a URL to specify a file that ends with. js
Windows object
The 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.
Feames.length of the number of child frames.
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, which is defined by the window that is opened 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.
The prompt ("message") displays a "Prompt" dialog box that requires the user to give the appropriate input based on the display message.
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 has all the properties of the Window object, except the Status,defaultstatus,name property.
Location objects
Contains information about the current URL.
Property
href entire URL string.
Protocol A string containing the first part of the URL, such as http:
The host contains a string with the host name: part of the port number in the URL. such as//www.cenpok.net/server/
Hostname A string containing the host name in the URL. such as http://www.cenpok.net
Port contains a string of port numbers that may exist in the URL.
Pathname after the "/" in the URL. such as ~list/index.htm
The string after the hash "#" (the CGI parameter).
Search "?" String after the number (CGI parameter).
Document Object
An object that contains information about the current document.
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, which is the URL from which the user is linked 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 a 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 store in order.
The number of href chains in the Links.length document.
Anchors[] Anchor (...) Array, which defines 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") is similar to write (), appending a carriage return at the end, only in the predetermined format text (
...
Or
...
Effect.
Clear () the current window.
Close () Closes the current window.
Form Object
Property
Name
The string value of the Name property in the
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.
The Elements[index] 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 handlers
Onfocus executes when the input focus is entered.
OnBlur is executed 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.