Encapsulation: Throws the same function code into a function and repeats the call.Encapsulate CSS functions: 1, you can get the element's style 2, you can modify the style of the element.The encapsulation process is circular and gradual,
As is well known, JavaScript can only access content that is under the same domain as the document containing it because of the security restrictions that front-end JavaScript makes across domain access. While the actual encoding we will encounter
This scenario is often encountered in front-end development, especially in NODEJS development (for example, Ajax): There are 3 (or more) Ajax requests, and the 2nd request relies on the 1th, and the 3rd request relies on 2nd, Then we may be after
The first: It is also the most stupid.
Array.prototype.unique1 = function () {var r = new Array ();Label:for (var i = 0, n = this.length; i for (var x = 0, y = r.length if (r[x] = = This[i]) {Continue label;}}R[r.length] = this[i];}return R;}The
Matching characters such as:
Jing Z 12345-Jing Z12345
ZF 12345-zf12345
Temporary 12345 Temporary 12345
Rules:
First digit: Chinese or letter second: The letter or the Chinese third digit can be a space can not
followed by a letter or number 5-7
One of the simplest of this mailbox authentication does not verify mailbox length and legality, such as input "I'm @fdd." Hello, yes, you can.
The code is as follows
Copy Code
function Is_email (str){if (Str.indexof ("@")
The first two only difference is that the loop and the order of the judgments are different, do-while than while more than one cycle, I do not give an example.
For loop I believe that we can not be ripe, we will see for-in this sentence.
This is
To delete an array-specified subscript:
The code is as follows
Copy Code
HTML code
/** Deletes an array to specify an element for the subscript.*/
The code is as follows
Copy Code
The code is as follows
Copy Code
Determines whether the start time is less than the end timeif ($ ("#txtBeginTime"). Length > 0 && $ ("#txtEndTime"). Length > 0) {if (Date.parse (Timeformattosql ("#txtBeginTime"). Val ()). Replace ("
Let's take a look at one of the simplest examples, which implements the display and hidden layers
The code is as follows
Copy Code
function $_ (ID) {return document.getElementById (ID);};function display (x) {$ (x).
The code is as follows
Copy Code
Properties:duration, overlap (default=1.0)
Gradientwipe (Gradual cleaning)
The code is as follows
Copy Code
Properties:duration, Gradientsize (default=0.25),
Ways to automatically refresh pages:1. Page Automatic refresh: Add the following code to the area
The code is as follows
Copy Code
"
20 of which means that the page is refreshed every 20 seconds.
2. Page
The Notification API is the browser's notification interface, which is used to display notification information on the user's desktop, both for desktop computers and for mobile phones. The specific implementation form is deployed by the browser
Tip: you can modify some code before running Simple Tab Lesson 1 Lesson 2 Lesson 3 Analysis of webpage special effects Respond to user operations Prompt Box effect
What is a variable?A variable is a container used to temporarily store values. In a program, the value stored in the variable can be changed.Variable Declaration (Declaring Variables)Declare a variable before using it. In Javascript, use var to
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