File tree Expand file tree Collapse file tree 2 files changed +8
-7
lines changed Expand file tree Collapse file tree 2 files changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -12,23 +12,24 @@ called a method of the object. Otherwise, they are called properties.
12
12
As it turns out, nearly everything in JavaScript is an object -- arrays,
13
13
functions, numbers, even strings -- and they all have properties and methods.
14
14
15
+
15
16
<javascript caption =" Creating an 'object literal' " >
16
17
var myObject = {
17
18
sayHello : function() {
18
19
console.log('hello');
19
20
},
20
-
21
21
myName : 'Rebecca'
22
22
};
23
-
24
23
myObject.sayHello(); // logs 'hello'
25
24
console.log(myObject.myName); // logs 'Rebecca'
26
25
</javascript >
27
26
27
+
28
28
When creating object literals, you should note that the key portion of each
29
29
key-value pair can be written as any valid JavaScript identifier, a string
30
30
(wrapped in quotes) or a number:
31
- <javascript >
31
+
32
+ <javascript caption =" test " >
32
33
var myObject = {
33
34
validIdentifier : 123,
34
35
'some string' : 456,
Original file line number Diff line number Diff line change 9
9
< h3 > < span > Quick Access</ span > </ h3 >
10
10
< div class ="cdn ">
11
11
< strong > CDN</ strong >
12
- < span > //ajax.googleapis.com/ajax/libs/jquery/1.5 .1/jquery.min.js</ span >
12
+ < span > //ajax.googleapis.com/ajax/libs/jquery/1.7 .1/jquery.min.js</ span >
13
13
</ div >
14
14
< div class ="download ">
15
- < strong > Download jQuery 1.5 .1:</ strong >
16
- < span > < a href ="# "> Minified < em > (29KB)</ em > </ a >
17
- < a href ="# "> Unminified < em > (212KB)</ em > </ a > </ span >
15
+ < strong > Download jQuery 1.7 .1:</ strong >
16
+ < span > < a href ="//code.jquery.com/jquery-1.7.1.min.js "> Minified < em > (29KB)</ em > </ a >
17
+ < a href ="//code.jquery.com/jquery-1.7.1.js "> Unminified < em > (212KB)</ em > </ a > </ span >
18
18
</ div >
19
19
< ul class ="footer-icon-links ">
20
20
< li class ="footer-icon icon-github "> < a href ="http://github.com/jquery/jquery "> Github < small > jQuery < br > Source</ small > </ a > </ li >
You can’t perform that action at this time.
0 commit comments