1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> |
---|
2 | |
---|
3 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> |
---|
4 | <head> |
---|
5 | <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> |
---|
6 | <script type="text/javascript" src="jquery-1.3.2.js"></script> |
---|
7 | <script type="text/javascript"> |
---|
8 | var greq = 0; |
---|
9 | function go() { |
---|
10 | var req = greq++; |
---|
11 | $.ajax({ |
---|
12 | type: "GET", |
---|
13 | url: "http://connorhd.uwcs.co.uk/jsontest.php", |
---|
14 | cache: false, |
---|
15 | dataType: "jsonp", |
---|
16 | success: function(data){ |
---|
17 | console.log('got data '+req); |
---|
18 | setTimeout('go()', 5000); |
---|
19 | }, |
---|
20 | error: function(){ |
---|
21 | console.log('got ERROR '+req); |
---|
22 | }, |
---|
23 | complete: function(x, textStatus) { |
---|
24 | console.log('got complete: '+textStatus+' - '+req); |
---|
25 | } |
---|
26 | }); |
---|
27 | }; |
---|
28 | $(document).ready(function() { |
---|
29 | go(); |
---|
30 | }); |
---|
31 | </script> |
---|
32 | </head> |
---|
33 | <body> |
---|
34 | Test |
---|
35 | </body> |
---|
36 | </html> |
---|