JavaScript First Knowledge

Source: Internet
Author: User

One.

HTML: Content.

CSS: Format.

JavaScript: Action.

All tags in HTML can have the name and ID attributes.

Java and JavaScript have little connection.

Java needs to be compiled, and Javascrpt is an explanatory language.

You need to place the JavaScript program in the HTML file. Can be placed in the HTML

Two.

The JavaScript declaration variable uses the var example: var a = "Hello World"; JavaScript variables do not have to declare what type.

Strings can also be compared in size.

Three:

Create object: var a = new object ();

You can add attributes and values directly to an object: example a.xyz = "123";

You can also delete the properties of an object. A.delete ("a");

Passes through A[i] to get the values of each property.

Four

Construction Method:

function person () {

Persion.prototype.name = "Dfs";

}

The prototype keyword is similar to Java's static:

Five:

Window: Global variables for the browser.

All global variables defined belong to the members of the window.

referencing external JavaScript files

<script src = "file name. js" ></script>

Event handler:

All tags can be placed onMouseOver, onmourseout events

body> Tag: onload--the label loading display unLoad before completion;

Simple dialog box: alert (); Confirm (); Prompt ();

Status bar: state;

Timer: SetInterval ();

Window control method: window.open (), Window.close ();

For example: <p onMouseOVer = "alert (')" > </p>

Six:

Doucument: Saves the document information in the HTML file.

Content: Form;paragraph;images;form;table;links, .....

Access all the information on the HTML page through the Doucument object model.

JavaScript First Knowledge

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.