1. Modifier
. Any character
* Match * The first 0 or multiple characters
+ Match + the first or more characters
? Matching? First 0 or 1 Character
^ Start with a character after ^
$ Ends with a character before $
[] Match a character in []
()
The following code is my test code, which is important:
Copy codeThe Code is as follows:/* global window, jQuery, validate_email, masterUI, $, rest */
/** Enable ECMAScript "strict" operation for this function. See more:
*
Each function is created with a prototype attribute by default, which contains a constructor attribute and a hidden property _ proto _ pointing to the Object __. The value of the constructor attribute is the object of the function. If you add new to
Is there a "class" in Javascript?
All objects In Javascript, except basic data (Undefined, Null, Boolean, Number, String), all others are objects ).In fact, objects in Javascript are a collection of data and functions. For example, we know:Copy
Complete the following cloze:
Copy codeThe Code is as follows:/* Create a queue with head0 header and tail0 tail */
Function IntList (head0, tail0 ){
This. head = head0 | 0;
This. tail = tail0 | null;
}
/* Return an IntList containing all the
Readonly and Disabled are two attributes used in a form. They both enable users not to change the content in the form field. However, there are minor differences between them, which are summarized as follows:
Readonly is only valid for input
Confirm () method
The confirm () method is used to display a dialog box with the specified message and OK and cancel buttons.
Note: If you click OK, confirm () returns true. If you click Cancel, confirm () returns false.
One type:Copy codeThe Code
In many cases, we use for to generate multiple node structures with the same structure, so we need to write a lot of code such as createElement, setAttribute, and appendChild.
However, we only need an html template to clone existing nodes, including
The function is assembled by analyzing the document. cookie string.
Review the operations on cookies in javascript:
You can use document. cookie = "userId = 111"; to add a cookie.
The full version can be used:Document. cookie = "userId = 111;
There are two main parts: one is the rolling content part; the other is the JS rolling code part. There are only two sentences.
I. Traditional rolling code
use Javascript to horizontally scroll news content!
[Ctrl + A select all Note: If you
Copy codeThe Code is as follows: window. onload = function (){
Var oDIv = document. getElementById ('ssssbox ');
Var sytleElemt = window. getComputedStyle (oDIv );
For (var I = 0; I If (
Typeof sytleelemts [sytleelemts [I]! = 'Undefined '&&
Instance JavaScript code
In the following code, we use the name attribute of the select element to set the attribute of the specific style to be accessed (in this example, the background color, this function can be used to set different CSS
The previous two articles have introduced how to achieve this step by dynamically loading JS files or JS modules.
First, the module loading and callback functions are separated by a synchronization policy, and then the module loading and callback
Data Type
JavaScript has five simple data types (also known as basic data types): Undefined, Null, Boolean, Number, and String. There is also a complex data type-Object, which is essentially composed of a group of unordered name-value pairs.
Typeof
• Simulate block-level scope
We all know that there is no block-level scope concept in JavaScript. We can simulate block-level scope by using closures. See the following example:
Copy codeThe Code is as follows: (function (){
For (var I = 0; I // Do
Object
Create
Object
Constructor
Public, private, privileged, static member
This, call, and apply
Exception Handling
Inheritance
Prototype
Object
In JavaScript, we can say that everything is object. So what is an object? An object is a set of
1. DOM0-level event handlerReturns a function value to an event handler property.
For example:
Copy codeThe Code is as follows: var btn = document. getElementById ("myBtn ");
Btn. onclick = funtion (){
Alert (this. id); // "myBtn"
}
Delete event,
1. Timeout call setTimeout ()
The setTimeout () method accepts two parameters. The first parameter is the function, and the second parameter is the time (in microseconds). The value ID is returned.
Copy codeThe Code is as follows: setTimeout
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