I. The main content of learning Javascript is:
1. Positioning and searching of HTML + JS Elements
2. Expand and close the tree menu
3. Implement layer hiding, display, pop-up layer and other special effects
4. Floating ads, pop-up ad window and other special effects
Ii. Principle
The user enters IE and sends the request to the client. The client requests are combined with the JS page. The server downloads the JS page containing the server and responds to the user.
III. Basic syntax
1. parseint (string): converts string to an integer.
2. parsefloat (string): converts a string to a float type.
Iv. Mechanism
1. The function is called together with the event of the form element: event name = "function name ()"
2. User-Defined Function ()
{
}
Note that every HTML node is an object and is familiar with (node: body, title ,.......)
5. Common Methods
Alert ("prompt message ")
Confirm ("prompt message returned results (true/false)")
Open ("url", "window name", "window features ")
Close ()
Showmodaldialog ()
SetTimeout ("function", 1000)
Vi. Window features
Toolbars: Toolbar
Scrollbars: scroll bar
Resizable: whether the window size can be changed
Location: Address Bar
Status: Status Bar
7. Window object
1. Window. Status = "the system is logging on ........";
Window. Screen. width = ........
2. Window. open ()
And so on
3. <a href = "javascript: OpenWindow ()"> </a>
4. <body onload = "OpenWindow ()">
8: date object, array object
VaR now = new date ();
VaR arr = new array ()
And so on
9: History
Back () load the previous URL of the History List
Forword () loads the next URL
Go ("url", or number)
10. Location object
Attribute: host port of host URL, hostname, href
Method: Assign ("url ").
Reload () Reload the item before the ticket
Replace ("url") replaces the document before the ticket
11:
Getelementbyid () is used to access the object of the DIV layer.
Getelementsbyname () is used to access the form elements in the same portal group, such as selecting all elements.
Div style to control the hiding and display of Layers
12. Introduction to common page coordinates: Image Display and hiding
Top, pixeltop: sets or returns the upper boundary of an image element.
Left, scrolltop: Page scroll height
* Called when the page is rolled: window. onscroll = move;