Daniel Clifford gave a wonderful speech at Google I/O 2012, "Breaking the Javascript Speed Limit
With V8 ". In his speech, he explained 13 simple
CodeThe optimization method allows your code to compile/run your JavaScript code more quickly in
In the previous article on javascript dynamic loading, we mentioned using the synchronous loading policy to implement this method, as shown in figure
Copy codeThe Code is as follows: Using ("jquery ");
Using ("User ");
$ ("# ID"). click (function ()
I. event stream
IE is a bubble event, that is, from the most specific event target to the least specific event target.
Netscape Navigator uses capture events, which are the opposite of the bubble events used in IE.
DOM Event streams support both
Inheritance
Inheritance is an essential feature of object-oriented languages. That is, one class can reuse the methods and attributes of another class. In JavaScript, the inheritance methods include the following methods: Object impersonating,
Factory method
Create and return specific types of objects.
Copy codeThe Code is as follows: function createCar (sColor, iDoors, iMpg ){
Var oTempCar = new Object ();
OTempCar. color = sColor;
OTempCar. doors = iDoors;
OTempCar. mpg =
Window object
Window operations Window objects are very useful for operating browser windows. developers can move or adjust the size of browser windows. You can perform these operations in four ways:MoveBy (dx, dy): Move dx pixels horizontally
I. Variables
• Global VariablesThe two features of JavaScript make it unexpected to unconsciously create global variables. First, you can use variables without even declaring them. Second, JavaScript has an implicit global concept, this means that
1.1.1 Summary
I believe that anyone with C ++, C #, Java, and other programming experience will not be familiar with this keyword. Javascript is an object-oriented programming language. It contains the this keyword like C ++, C #, or Java. Next we
Today, Friday, I am very idle. Sitting in front of the computer has nothing to do with it. People in the product line have not raised any new requirements. There may be new requirements and work arrangements next week, but that is what will happen
The first important content in this book is interfaces.
Everyone should be familiar with Interfaces. Simply put, interfaces are a contract or specification. Interfaces can be easily implemented in a strong facial object language. However, there is
1. Create a regular expression
Creating a regular expression is similar to creating a string. Creating a regular expression provides two Methods: Using the new operator and using the literal method.
Copy codeCode: var dog = new RegExp ('Dog'); //
In Javascript, the first parameter received by setTimeout and setInterval is a string or a function. When setTimeout is used to call the method of this object in an object
Copy codeThe Code is as follows: function obj (){
This. fn = function
The specific question is as follows:
Select N numbers from 1-9 to Form N-digit numbers that are not repeated. Numbers are numbered from small to large. When you enter any number M, you can find the corresponding number.
. For example, N = 3, M = 213
Minimalism
The Dutch programmer Gabor de Mooij proposed a new method that is better than Object. create (), which he calls "minimalist approach ). This is also my recommended method.
3. 1 EncapsulationThis method does not use this and prototype,
When I was writing this article, Baidu searched for information and found an article by yuanyou, which was well written, but I didn't want to give up after I wrote it, so I took a lot of things in it! ~~
[Translation] JavaScript Scoping and
JavaScript case sensitive: In JavaScript, variables and functions are case sensitive. For example:
Copy codeThe Code is as follows: function myfunction () {} and
Function myFunction () {} is different
The core objects such as Array and Object in
One of the JavaScript learning notes: jQuery writing image proportional scaling and pre-loading
In the past, when JavaScript was always used, I wrote several functions on the page. Basically, I didn't consider function encapsulation and reuse.
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