1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" |
---|
2 | "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> |
---|
3 | <html xmlns="http://www.w3.org/1999/xhtml"> |
---|
4 | <head> |
---|
5 | <meta http-equiv="content-type" content="text/html; charset=utf-8"/> |
---|
6 | <title>jQuery bugs</title> |
---|
7 | <script type="text/javascript" src="jquery-1.3.1.js"></script> |
---|
8 | <script type="text/javascript"> |
---|
9 | //<![CDATA[ |
---|
10 | |
---|
11 | $(function () { // DOM read |
---|
12 | var p1 = []; // array |
---|
13 | var p2 = {}; // object |
---|
14 | |
---|
15 | p1[1] = 'one'; |
---|
16 | p1[2] = 'two'; |
---|
17 | |
---|
18 | p2[1] = 'one'; |
---|
19 | p2[2] = 'two'; |
---|
20 | |
---|
21 | $.each(p1, function(i, v) { |
---|
22 | $('#output').append('['+i+'] '+v+'<br />'); |
---|
23 | }); |
---|
24 | $('#output').append('<br />'); |
---|
25 | $.each(p2, function(i, v) { |
---|
26 | $('#output').append('['+i+'] '+v+'<br />'); |
---|
27 | }); |
---|
28 | }); |
---|
29 | |
---|
30 | //]]> |
---|
31 | </script> |
---|
32 | </head> |
---|
33 | <body> |
---|
34 | <div id="output"></div> |
---|
35 | </body> |
---|
36 | </html> |
---|