MouseDown when creating drag objects, MouseUp release objects, the principle of clear is actually very simple.
Simple Drag Implementation code:
simple Drag implementation Drag Me & Lt;script type= "Text/javascript" > var VVG = {};
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
1. Warning Prompt boxAlert ("Text").
Ex.
[Ctrl + A All SELECT Note: If the need to introduce external JS need to refresh to perform]
2. Confirm Prompt box (confirm, return True or False)
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
train of Thought
HTML5 's canvas provides the Getimagedata interface to obtain the data in the canvas, so we can first draw the picture on the DrawImage with the canvas interface and then get the image data matrix by Getimagedata.
Note that while
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
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
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
In this Liezi, we practiced table operations, including: tbodies, rows, cells, and how to sort the array: sort
First code:
Copy Code code as follows:
table sorting
2
bbb
5
eee
3
ccc
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
The concept of scope in JS:
Represents the area in which a variable or function works, referring to the context in which they are executed, that is, the context execution environment. JavaScript has only two scopes: global scope and local scope,
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