ds.html revision d09f08444b6d2983107cacd360e2919da893bc4a
<!doctype html>
<html lang="en">
<head>
<title>ds</title>
</head>
<body>
<script>
// testy test code below.
YUI({
debug: true,
base : "/build/",
filter : "debug"
}).use('datasource', function (Y) {
var myDS = new Y.DataSource.Get({
source : "http://query.yahooapis.com/v1/public/yql?" +
"format=json&" +
"env=http%3A%2F%2Fdatatables.org%2Falltables.env&",
scriptCallbackParam : "callback"
});
myDS.plug({fn : Y.Plugin.DataSourceJSONSchema, cfg : {
schema : {
}
}});
myDS.sendRequest("q=" + encodeURIComponent(
"select * from search.suggest where query =\"foo\" limit 10"
), {
success : handleResults,
failure : handleResults
});
function handleResults (e) {
console.log("handleResults", arguments, e.response);
};
});
</script>
</body>
</html>