2.1 syntax
Case-sensitive, weak variable type, line-and-tail semicolons are optional, comments are diagonal lines, and parentheses indicate code blocks.
2.2 VariablesVariables are declared using var. Naming rules for variables: the first character
2.8 reference type
1. Object Class All classes in ECMAScript are inherited by the Object class.
The Object class has the following attributes:
Constructor: A Reference (pointer) to the function that creates an Object. For an Object class, this
Similar to dynamic scripts, a dynamic style is a style that does not exist when the page is loaded; a dynamic style is dynamically added to the page after the page is loaded.
The following typical element is used as an example:
using DOM code,
Simply put, the context of function execution is changed, which is the most basic usage. The basic difference between the two methods is that parameter passing is different.
Call (obj, arg1, arg2, arg3); call the first parameter to pass the object,
First of all, the Framework used is of course my Framework mass Framework. Of course, you can use other frameworks, such as jQuery. There is nothing complicated. As long as you understand the principle, you can make it all at once. Presumably, you
The earliest curry function is a little polymorphism, that is, the Branch is selected internally Based on the function parameters:
Copy codeThe Code is as follows: // http://www.openlaszlo.org/pipermail/laszlo-user/2005-March/000350.html
//★★On 8
Function add (x) {________}; alert (add (2) (3) (4); // fill in the blanks to make the result 9
Solution 1,
Copy codeThe Code is as follows: // large
Function add (x ){
Var c = 0;
Return function (x ){
C = c + x; arguments. callee. toString =
Copy codeThe Code is as follows :/*!
* JLip JavaScript Library v0.1
*
* Copyright 2012, Lip2up (lip2up@qq.com)
* Just for free use, NO LICENSE
*/
(Function (){
Function extend (target, props ){
For (var m in props ){
If (target [m] === undefined)
It is enough to explain how important interfaces are in the Object-Oriented field. However, JavaScript does not have built-in interface mechanisms like other object-oriented advanced languages (such as C #, Java, and C ++, to determine that a group
Preface
In this chapter, we will explain 3rd of The Five Principles of S.O.L. I. D In JavaScript language implementation, and The Principle of LSP (The Liskov Substitution Principle
Preface
JavaScript does not contain the traditional class inheritance model, but uses the prototypal prototype model.
Although this is often mentioned as a disadvantage of JavaScript, prototype-based inheritance models are more powerful than
That is to say, moving to the object's sub-object is also considered onmouseout. However, this often fails to achieve the expected results. This is caused by the bubbling feature of javascript itself (that is, the event is triggered on the child
Phase 1:
Copy codeThe Code is as follows: function (){
This. funB = function (){
Alert ('a: funb ');
};
}
A. prototype = {
FunA: function (){
Alert ('a: funa ');
}
};
Function B (){
}
Function extend (sub, parent ){
Sub. prototype = new parent
To simulate a three-dimensional effect in a two-dimensional space, you need to convert the three-dimensional coordinates into two-dimensional coordinates. The most basic basis is: the farther the East and West are, the smaller the size is, and the
The following is a simple example:
Copy codeThe Code is as follows: var o = {flag: true };
Var test = !! O. flag; // equivalent to var test = o. flag | false;
Alert (test );
Because it is used for null and undefined! The true result is generated
First, let's take a look at the English meaning of these two words (from youdao dictionary ). First, property:
Copy codeThe Code is as follows: property ['pr ɔ p ti]
N. Nature, performance, property, ownership
English meaning:
Any area set aside
Object. prototype
JavaScript is inherited based on prototype. Any object has a prototype attribute. Object. prototype is the root of all objects and cannot be changed.
Copy codeThe Code is as follows: Object. prototype = null;
Alert (Object.
It turned out to be very simple and similar to implementing this in C # language. It only calls two languages, and writing code in this way is also good for the system performance. : The function implemented by the invert selection.
Below we will
At the beginning, many people will use the jquery selector to compare with the two APIs (I am also). The similarities and differences are actually okay, however, some people misunderstand the implementation of these two APIs in the browser,
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