Javascript compile Method

Source: Internet
Author: User
Tags log e natural logarithm

Parse command in the while Command Format
For instruction material-type built-in parseint () internal letter data
Special Character new declaration variable
This indicates the overall change data and the region change data
Parameter column parse float () built-in Letter Number
Eval () internal letter data transport operator String object embedding
If command 'distinct' column array object adequacy date object adequacy
On unload event data math object embedding on mouse over event
Navigator object on mouse over event window object failover Method
On click event window object embedding on abort event
Window object method break command on Blur event
On change event continue command on Error Event
Event handling on Focus event on Load event
On select event on sub mit event

--------------------------------------------------------------------------------

Format

<Script language = "JavaScript">

Statement

</SCRIPT>

Usually placed in

Solution

/* → Begin, */→ end
// → The entire row is unrecoverable.

Material-type Indexing

Octal: Start with 0, followed by 0-7. Example: 011

Hexadecimal: starting with 0x or 0x, followed by 0-9, A-F, A-F

Example: 0xff or 0xff

1e6 indicates 1000000; 25e-2 indicates 0.25; 4.5e5 indicates 450000

String: used to enclose the strings "or" single quotes. Example: 'a'; "11"

Special characters

\ A: delimiter
\ B: regressing character
\ F: Skip character
\ N: delimiter column character
\ R: return character
\ T: Tab character
\ ": Escape" Character
\: Character display \ character

Declaring changes: var changing data names

VaR variable data name initial = initial value → set the initial value of the variable data
VaR variable data name = NULL → it indicates that the variable data is empty.
The first character of the Data name must be an English letter or a base character _
Do not include blank characters or standard characters in data name changes.
Change the data name to shard size

Overall changes and region changes

Overall changes: the changes advertised outside of the function. No matter whether VaR is used for the declaration, or if VaR is not used for the declaration in the function. Valid for the entire program.

Region changes: the changes announced by using VAR in the function. The valid parameter is the function number.

Region Column

Metric column name metric = new array (data)

For example, scores = new array (10); → 10 shard columns are declared, except for scores [0]… Scores [9]; if you want to set its value to: Scores [0] = numeric value;

Definition Function

Function function name (numbers 1, numbers 2 ,......)

{

Function content

}

Generally, the function definition is set to

Operation Operator

+ Add;-factorial; * multiplication;/division; % get division number; ++ Add 1 each time; -- 1 each time
+ = (For example, I + = J, that is, I = I + J);-= (for example, I-= J, that is, I = I-j ); * = (for example, I * = J, that is, I = I * j)
/= (For example, I/= J, that is, I = I/J); = equals

> Greater than; <smaller than; = equal ;! = Not equal to;> = greater than equal to; <= less than equal

& And (and); | or (OR );! No (not)

+ The string is merged into a string.

True/false judgment criteria? Formula 1: formula 2

Example: J = (I> 5 )? 10: 20) → when I> 5 hours J = 10, when I <5 hours J = 20

Number 1 & number 2 → two numbers are converted into two hexadecimal form, and the operation is performed.

Number 1 | Number 2 → two numbers are converted into two hexadecimal notation for or calculation

Number 1 ^ Number 2 → two numbers are converted into two hexadecimal form and then run XOR.

Data <left-to-left displacement> data-to-left displacement margin; right margin 0

Example: 20> 3 → 20 binary system: 00010100 after displacement, 10100000 is 160.

DATA> Number of shifts to the right → number of shifts to the right; 0 for left direction; Positive Direction

For example, 20 <3 → 20 binary system: 00010100 after the displacement is 00000010, that is, 2

DATA> Number of shifts to the right → Number of shifted digits to the right; left margin 0; positive margin changes

If command

If (Criterion 1)

{

Formula 1

}

Else

{

Formula 2

}

If the judgment formula is true, then the row Calculation Formula 1 is not followed by the row calculation formula 2.

While command

While (Sentence Type)

{

Formula

}

If the judgment formula is true, the calculation formula should be used until the judgment formula is invalid.

For command

For)

{

Formula

}

If the judgment formula is true, the calculation formula should be used until the judgment formula is invalid.

Parseint () internal function

Returns the integer value of the starting position in the string Number of the specified string. If the string does not contain an integer or the start position is not an integer, the value of this function is returned to 0.

For example, a = parseint ("11 ABC"); → the result of A is 11.

For example, a = parseint ("1A test", 16); → the result of a is the hexadecimal 1A instead of 1.

For example, a = parseint ("1A test", 10); → the result of A is 1 of the 10 hexadecimal notation.

New: Create an object attachment; The String object cannot use new

This: indicates the objects currently in use or definition.

With:

Parsefloat () internal correspondence

Locate the Floating Point Number of the start position in the specified string. If the string does not contain the floating point number or the start position is not the floating point number, the value of this function is returned to 0.

For example, a = parsefloat ("11.21 ABC"); → the result of A is 11.21.

Eval () internal letter number

Processing the strings in the preceding statement as a formula or statement

For example, a = eval ("20 + 1 + 4"); → the result of A is 25.

String object atomicity: Object Name atomicity. Object atomicity

Length: the length of the response string.
Anchor (): New Production endpoints
Link (): produce new links
Big (): enlarge the string
Small (): Small string
Blink (): invalidates the string "ie4)
Bold (): bold
Fixed (): indicates the input.
Italics (): italics
Strike (): adds the delimiter in the string to divide the delimiter.
Fontcolor (): sets the color of the string.
Fontsize (): Set the font size
Sub (): Bottom mark
Sup (): Upper mark
Charat (): returns the position specified by the string.
Indexof (): Search for the substring from the beginning and restore the substring.
Lastindexof (): searches for the starting string from the end and returns the position.
Substring (): returns the substring specified by the string.
Tolowercase (): All characters are written as small characters.
Touppercase (): All characters must be uppercase letters

Attribute column array object atomicity: an ordered variable set

Length: gets the length of the distinct column.
Join (): Quickly combines all elements in the combine column into a string.
Reverse (): reverse sequence of elements in the rows Column
Sort (): sort column elements sort order sort by Increment

Date object atomicity

Format 1: Variable = new date ();

Format 2: Change Data = new date (month, day, year, hour, minute, second );

Format 3: Change Data = new date (year, month, day );

Format 4: Change Data = new date (year, month, day, hour, minute, second );

Setdate (): set the date object date, interval between 1 and ~ 31
Sethours (): When the date object is set, the value ranges from 0 ~ 23
Setminutes (): Set the minute of the date object. The value ranges from 0 ~ 59
Setmonth (): Set the month of the date object. The value ranges from 0 ~ 11 (0 table January)
Setseconds (): Set the seconds of the date object, interval between 0 and ~ 59
Settime (): Set the object time, which is counted from on January 1, 1970, in milliseconds.
Setyear (): the year in which the object time is set. The system time starts from 1900.
Getdate (): Get the date object day
Getday (): week in which the date object is obtained
Gethours (): When the date object is obtained
Getminutes (): Get the minute of the date object
Getmonth (): month in which the date object is obtained
Getseconds (): the second in which the date object is obtained.
Gettime (): obtains the object time, which is counted from on January 1, 1970, in milliseconds.
Getyear (): the year in which the object is acquired
Gettimezoneoffset (): gets the time difference between the local time and the standard time, in milliseconds
Togmtstring (): converts the local time to the Standard Time (GMT ).
Tolocalstring (): Mark the time (GMT) when the local time is used.
Parse (): converts the time string of the specified data object to the number of milliseconds that elapsed since, January 1, 1970 (local time)
UTC (): converts the time string of the specified data object to the number of milliseconds that elapsed since, January 1, 1970 (Greenwich Mean Time)

Mathematical math object atomicity

Format: Math. atomicity

E: natural data E = 2.718281828459045
Ln2: LN 2 = 0.6931471805599453
Ln10: ln 10 = 2.302585092994046
Log2e: log2e = 1.4426950408889633
Log10e: log E = 0.4342944819032518
Pi: π = 1, 3.141592653589793
Sqrt1_2 = 0.7071067811865476
Sqrt2 = 1.4142135623730951
ABS (): WEIGHT PAIR
Cos (): String Function
ACOs (): returns the string function.
Sin (): sine number
Asins (): arcsin Function
Tan (): tangent function
Atan (): returns the number of returns.
Ceil (): returns the smallest integer greater than or equal
Floor (): Take the largest integer smaller than or equal
Max (): two-digit ratio, whichever
Min (): two-digit ratio, minimum
Exp (): The power of natural data
Log (): natural logarithm
Pow (): Power
Randow (): 0 ~ 1
Round (): four to five
SQRT (): calculates the square root of a number.

Navigator object: navigator. atomicity

Appcodename: the receiver is used on behalf of Mozilla.
Appname: The worker name.
Appversion: the version of the scanner.
Useragent: User Interface Name

Test Method of window objects

Operner: I got an examination of the opening window.
Parent
SELF: The exam passed the current exam window.
Window
Top: the top navigation pane of the browser, usually the first opening window.

Atomicity of window objects

Location: contains the URL information shown in the Response Window
Document: the website itself
History: contains the previous and later website information.
Defaultstatus: indicates the initial reset information displayed on the zookeeper sequence column.
Frames [Index]
Name: Dialog Box
Length: Number of frames in the upper window
Status

Window object Method

Alert (): Alert recipient alert
Blur (): Move the ghost window to the background
Cleattimeout (): clears the timer
Close (): closing window
Confirm (): confirm the caller
Focus (): Move the upper-right window to the top-right corner
Open (): open a new window

Name: blank = Window. Open ("url", "blank window feature ");

Features of the hidden window: the height of the hidden window is □, the width is □, the toolbar of the tool column is = 0,
Required bytes column status = 0 No

Prompt (): displays the text that the caller calls
SetTimeout (): set the timer

Break command: jump out of the cycle

Continue command

When you encounter a continue, ignore the following formula to jump back to the cycle. The start formula is used to skip the next row.

Event handling procedure

<Common HTML file mark event handling = "event handling method">

Onload event: occurs when a file or image is merged. Must be stored in <body>

OnUnload Event: occurs when the user opens a file. Must be stored in <body>

Onmouseover event

<A href = "Address" onmouseover = "event handlingProgram"> Text </a>

When the user moves the mouse to the cursor

Onmouseover event

This occurs when the user moves the mouse away from the camera.

Onclick event: This event occurs when the user clicks the marker in the table.

Onabort event: This event occurs when a user adds a video to an image.

Onblur event: occurs when the objects in the queue are out of attention.

Onchange event: occurs when a text location is changed by the user

Onerror event: occurs when a text or image cannot be entered.

Onfocus event: This event occurs when the specified object is noticed.

Onselect event: This event occurs when a user selects a text field.

Onsubmit event: generated when the user orders the table

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.