1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- <!DOCTYPE html>
- <html>
- <head>
- <script type=" text/javascript">
-
- var httpClient=function(){
- var movies;
- //this.get=function(eUrl,eCallback);{
- var onHttpRequest=new XMLHttpRequest({mozSystem: true});
- onHttpRequest.onreadystatechange=function(){
- if(onHttpRequest.readyState==4 &&onHttpRequest.status ==200)
- {
-
- movies=JSON.parse(onHttpRequest.responseText);
- for(var i=0;i<movies.data.length;i++){
- var movie=movies.data[i];
- if(movie[10]=="Golden Gate Bridge"){
- // document.getElementById('result').innerHTML +=(movie[8]+ " "+movie[9]+" "+movie[12]) + "<br>";
- document.getElementById('result').innerHTML +=(movie[8] + " " + movie[9] + " " + movie[12]) + "<br>";
- }
- }
- }
- // onHttpRequest.open('GET',eUrl,true);
- // onHttpRequest.send();
- }
-
- var theurl='https://data.sfgov.org/api/views/yitu-d5am/rows.json?accessType=DOWNLOAD';
- // var client=new HttpClient();
- // client.get(theurl,function(response) ){
- // var response1=JSON.parse(response);
- // });
- onHttpRequest.open("GET",theurl,true);
- onHttpRequest.setRequestHeader("Content-Type","text/plain");
- onHttpRequest.send();
- return movies;
- }
- httpClient();
- </script>
-
- </head>
- <body>
- </body>
- </html>
|