1. Detect Nan
In mathematics, an arbitrary value x is always equal to itself:
x = X
However, this rule does not apply to = = = and NaN:
Copy Code code as follows:
> nan = = Nan
False
As a result, you cannot find this Nan
The relationship between the function scope of Javascript, the calling object, and the closure is subtle, and there are a lot of articles about them, but it's hard to understand why many beginners have difficulty understanding them. I will try to
Because of the needs of the work, I want to write a script at the end of the Web page, the data submitted to the system in batches. So I thought of the Greasemonkey plug-in, so began to write, found that the problem solved very smoothly. But in
Let's look at a traditional inheritance code:
Copy Code code as follows:
To define a super class
function Father () {
THIS.name = "Father";
}
Father.prototype.theSuperValue = ["NO1", "NO2"];
Defining subclasses
function
first, the question of the proposed
Let's take a look at the following code, and note that the following code does not run in the browser's developer tool (such as Firebug, Chrome Developer tool), which is explained later:
Why we can delete an
Animation principle
The so-called animation, is through the movement of some columns to form a moving picture. In the Web page, we can change the elements of the CSS value, to achieve the effect of moving.
The formula to use
Total distance S =
The first time to be swallowed, superficial understanding, feeling suddenly, the result of sleep at night to find a lot of problems, what do not understand, see the second time, found that is so. After a few days to use, found that the original
Copy Code code as follows:
Windows 98
Win2000 or XP
SendKeys (args[]) method Detailed (VB):
vb.net using SendKeys remote control:
Everyone in the VB6 have used SendKeys, the screen by sending the keyboard events indirectly
Do you know what the following JavaScript code is going to do, and what is the value of alert?
Copy Code code as follows:
var foo = 1;
function Bar () {
if (!foo) {
var foo = 10;
}
Alert (foo);
}
Bar ();
If the
Now popular Twitter and other micro-blogging sites, there is a good user experience, that is, in the text box input text, will automatically statistical input characters, and display the user can also enter the characters, in the limited 140 words
String Object
1, Str.match (REGEXP)
Search for a matching regexp string in str and save it back in an array.
If RegExp is not a global setting (/g), match only once
Copy Code code as follows:
Ways to detect Browsers
1. Object feature detection method: A general method for judging browser capabilities. You can use this method if you are more concerned about the capabilities of your browser than the actual identity. This method is used to
Objective
Basically, all JS data types have both methods, except NULL. They both solve the problem of JavaScript value operations and display, and overrides increase the optimizations they invoke.
Test analysis
First look at one example:
1.1.1 Summary
Believe that you have C + +, C # or Java programming experience, you are familiar with this keyword. Since JavaScript is an object-oriented programming language that contains the This keyword as C + +, C #, or Java, we'll introduce
Preface
In the previous article, we defined the matrix, this article we will add some common methods to the matrix.
tostring Method
The ToString method is often used as a description of the object as a string, so we define this method as an
In your project, you need to quickly detect whether the browser supports a CSS3 feature, such as detecting whether "transform" is supported, and then my layout will have two completely different layouts.
Of course, aside from the quick approach
One, two brackets added
[] + []
The brackets do not have the function of a statement block, so the two brackets here are an array. The addition of two arrays (object types) is first converted to a value type (the base type).
1, convert to value
Array.prototype.push
Push adds an item to the tail of the array and updates the length to return the array lengths.
What happens if object uses push?
Looking at the code below, obj works like an array. Length is automatically updated.
Copy
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