1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> |
---|
2 | <html> |
---|
3 | <head> |
---|
4 | <title>Tester</title> |
---|
5 | <style type="text/css"> |
---|
6 | #container { background:yellow; width:200px; } |
---|
7 | </style> |
---|
8 | <script type="text/javascript" src="../jquery.js"></script> |
---|
9 | <script type="text/javascript"> |
---|
10 | function doIt() { |
---|
11 | $.ajax({ |
---|
12 | type: "GET", |
---|
13 | url: "json.js", |
---|
14 | dataType: "json", |
---|
15 | success: function (json) { |
---|
16 | alert(json.data); |
---|
17 | } |
---|
18 | }); |
---|
19 | } |
---|
20 | |
---|
21 | $(function () { |
---|
22 | $("#doit").click(doIt); |
---|
23 | }); |
---|
24 | </script> |
---|
25 | </head> |
---|
26 | <body> |
---|
27 | <button id="doit">Do It</button> |
---|
28 | <div id="container"> |
---|
29 | Hi |
---|
30 | </div> |
---|
31 | <div id="adiv"></div> |
---|
32 | </body> |
---|
33 | </html> |
---|