JS & Jquery

Get Started. It's Free
or sign up with your email address
Rocket clouds
JS & Jquery by Mind Map: JS & Jquery

1. JS

1.1. 2013/10

1.2. The three layers of a Web page

1.2.1. Bad Examples

1.3. Some variables

1.3.1. var a = 1, b = 2, sum = a + b, myobject = {}, i, j;

1.3.2. NaN

1.3.3. null

1.3.4. undefined

1.3.5. Array & Object

1.3.6. var function VS function

1.3.7. null == undefined?

1.3.7.1. (object==null) == (object==undefined) == (!object)

1.4. Some grammar

1.4.1. For

1.4.2. While

1.4.3. Switch

1.4.4. If

1.4.5. ?:

1.5. Operator PK

1.5.1. == VS ===

1.5.2. ++i VS i++

1.6. Some habits

1.6.1. 4 spaces (or tab)

1.6.2. White Space

1.6.2.1. After the commas that delimit array items: var a = [1, 2, 3];

1.6.2.2. Initializing multiple variables (i and max) in a for loop: for (var i = 0, max = 10; i < max; i += 1) {...}

1.6.2.3. After the semicolons that separate the parts of a for loop: for example, for (var i = 0; i < 10; i += 1) {...}

1.6.2.4. Delimiting function arguments: myFunc(a, b, c)

1.6.3. Prevents logical errors when a variable is used before it’s

1.6.4. Naming Conventions

1.6.4.1. Variable names should be nouns such as car or person .

1.6.4.2. Function names should begin with a verb such as getName() . Functions that return Boolean values typically begin with is , as in isEnabled() .

1.6.4.3. Use logical names for both variables and functions, without worrying about the length.

1.6.4.4. etc...

1.6.5. HACKS

1.6.5.1. Because of browser differences, JavaScript code typically contains some hacks.put that in a comment

1.6.6. eval() is evil.

1.6.7. string combine with "join"

2. Jquery

2.1. Selector

2.2. DOM Traversal

2.2.1. $(selector)

2.2.2. .find

2.2.3. .filter

2.2.4. .first

2.2.5. .last

2.2.6. etc

2.3. events

2.3.1. click、change、keyPress、etc

2.3.2. preventDefault

2.3.3. Propagation

2.3.4. stopPropagation

2.3.5. stopImmediatePropagation

2.3.6. stopPropagation vs stopImmediatePropagation

2.4. Dom on the fly

2.4.1. Creates DOM elements on the fly from the provided string of raw HTML.

2.4.1.1. $( "<img />")

2.4.1.2. $("<div></div>")

3. Jquery Plugin

3.1. our plugins

3.2. Address Selector、Components

4. Module pattern

4.1. module

4.2. OrderList、ConvertFlow

5. 延伸閱讀

5.1. JavaScript Design Patterns

5.2. requirejs

5.3. backbone

5.4. Ember

6. client-server

6.1. without JavaScript

6.2. with JavaScript

7. Quiz

7.1. Propagation Quiz

7.2. preventDefault Quiz

7.3. == VS ===

7.4. null === undefined

7.5. var function VS function

8. Pratice

8.1. Module

8.2. Jquery Plugin