-
Notifications
You must be signed in to change notification settings - Fork 4
/
testAsync.html
87 lines (77 loc) · 3.13 KB
/
testAsync.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Jasmine Spec Runner v2.0.0</title>
<link rel="shortcut icon" type="image/png" href="lib/jasmine-2.0.0/jasmine_favicon.png">
<link rel="stylesheet" type="text/css" href="lib/jasmine-2.0.0/jasmine.css">
<script type="text/javascript" src="lib/jasmine-2.0.0/jasmine.js"></script>
<script type="text/javascript" src="lib/jasmine-2.0.0/jasmine-html.js"></script>
<script type="text/javascript" src="lib/jasmine-2.0.0/boot.js"></script>
<!-- include library files here... -->
<script type="text/javascript" src="lib/d3/d3.v3.js"></script>
<script type="text/javascript" src="lib/jquery/jquery-2.0.2.js "></script>
<script type="text/javascript" src="lib/jasmine-jquery.js"></script>
<!-- include source files here... -->
<script type="text/javascript" src="src/hydrograph.js"></script>
<!-- include spec files here... -->
<script type="text/javascript" src="spec/spec.datafeeds.js"></script>
</head>
<body>
<h1>Test of data server availability</h1>
<h4>TU NEXRAD service</h4>
<p>NOTE: This service is currently only available from TU IP addresses.</p>
<ul>
<li>
View JSON result: <a href="https://10.55.17.48:5000/nexradTS/id=01646500/startdate=2012-01-01/enddate=2012-01-02">https://10.55.17.48:5000/nexradTS/id=01646500/startdate=2012-01-01/enddate=2012-01-02</a>
</li>
<li>
HTTP status code: <span id="TUstatusCode"></span>
</li>
<li>
return text: <span id="TUstatusText"></span>
</li>
</ul>
<br>
<h4>USGS real-time stream gauge service</h4>
<ul>
<li>
View JSON result: <a href="https://waterservices.usgs.gov/nwis/iv/?format=json&sites=01646500¶meterCd=00060">https://waterservices.usgs.gov/nwis/iv/?format=json&sites=01646500¶meterCd=00060</a>
</li>
<li>
HTTP status code: <span id="USGSstatusCode"></span>
</li>
<li>
return text: <span id="USGSstatusText"></span>
</li>
</ul>
<script type="text/javascript">
$.ajax({
url : "https://10.55.17.48:5000/nexradTS/id=01646500/startdate=2012-01-01/enddate=2012-01-02",
dataType : "json",
error : function(request, textStatus, errorThrown) {
$("#statusCode").append(errorThrown);
},
complete : function(tuJSON) {
console.log("request complete");
console.log(tuJSON);
$("#TUstatusCode").append(tuJSON.status);
$("#TUstatusText").append(tuJSON.statusText);
}
});
$.ajax({
url : "https://waterservices.usgs.gov/nwis/iv/?format=json&sites=01646500¶meterCd=00060",
dataType : "json",
error : function(request, textStatus, errorThrown) {
$("#USGSstatusCode").append(errorThrown);
},
complete : function(JSON) {
console.log("request complete");
console.log(JSON);
$("#USGSstatusCode").append(JSON.status);
$("#USGSstatusText").append(JSON.statusText);
}
});
</script>
</body>
</html>