4.19 JavaScript Learning

Source: Internet
Author: User

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;

 

 

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.