Ajax request example
<!DOCTYPE html> | |
<meta charset="utf-8"> | |
<style> | |
body { | |
font: 10px sans-serif; | |
} | |
</style> | |
<body> | |
<pre id="result"></pre> | |
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js" type="text/javascript"></script> | |
<script> | |
$(function(){ | |
$.ajax({ | |
url: "http://query.yahooapis.com/v1/public/yql/", | |
dataType: "json", | |
data: { | |
"env":"http://github.com/spier/yql_worldbank/raw/master/alltables.env", | |
"q":'select * from weather.forecast where woeid=2502265', | |
"format": "json", | |
"jsonp" : "?" | |
}, | |
success: function(res) { | |
$("#result").text(JSON.stringify(res,2,2)); | |
} | |
}); | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment