Simple summary of JS knowledge points

Source: Internet
Author: User

JS (JavaScript) is a kind of explanatory language

is weak / dynamic

The first to use for form validation

Five parts of JS:

1. Core language Definitions

2. native objects and built-in objects

5boolean

3.BOM

4.DOM

5. Event-Handling model

Data type

1.Undefined

2.Number

3.Object

4.String

When the function has no explicit return value, the value returned is undefined

the single and double quotes in JS are not very different, they are all strings.

BOM: Browser Object model

The top level window

The size of the page can be obtained by DOM to operate

SetTimeout ()// execute only once

SetInterval ()//Dead loop

Document.images// get a collection of all pictures

window.location//Address bar

Window.history//historical record

Window.history.go (-1)//return to upper level

Window.navigator//Get the version of the operating system

Dom

Document

API a set of functions / Properties

Document Object Model

document.getElementById ();

InnerHTML (); (select/table cannot be used directly )

Node

InnerText ();

Text

Document.childnodes child Nodes [ including element nodes and text nodes ]//contains text in addition to standard elements

Event

Definition : Interaction between user and page

Handling of events

    1. Traditional : Assignment Operation , The original does not exist
    2. Now : add to the inside ( Disadvantage browser problem )

Event classification

    1. Mouse

MouseDown, MouseUp, MouseOver, mouseout

    1. Keyboard

KeyDown, KeyPress, KeyUp

    1. Html

Load, focus, blur, change, select

This event

This pass value

Event occurrence itself, low version IE (window.event)

Application section

    1. Control style

Background-color = = = BackgroundColor

Document.body.style.backgroundColor

Document.body.className

    1. Regular expressions

/^ Start $ end/

    1. *: Matches 0 to N characters
    2. +:1 to N characters
    3. ?: 0 to 1
    4. {} scope
    5. [789] can be 7 for 8 9,[m-n] range

\. Enter a decimal point

Regular Expressions: Inefficient execution

Jquery

$===jquery

GT () In addition to the above

<form action= "" method= "Post/get" ></form>

Post submissions are not displayed in the navigation bar

Get submissions are displayed in the navigation bar above

JS get form

    1. document.getElementById ();
    2. Document.getelementsbynames () [];
    3. document.getElementsByTagName () [];
    4. document.forms[0]/document.forms[]
    5. Document.
    6. Document.body.childNodes then uses the loop to determine whether the form element

JQuery get form

    1. $ (ID);
    2. $ (Class:eq ());
    3. $ ("from"). EQ ();
    4. $ ("action=": eq () ")

Input Type Property

    1. Text
    2. Botton
    3. File
    4. Radio
    5. Password
    6. Hidden
    7. Submit
    8. Reset
    9. Checkbox
    10. Image

Select

Textarea

Jquery-ui

Simple summary of JS knowledge points

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.