1
YUI.add('yql-winjs', function (Y, NAME) {
4
* WinJS plugin for YQL to use native XHR to make requests instead of JSONP.
5
* Not required by the user, it's conditionally loaded and should "just work".
10
//Over writes Y.YQLRequest._send to use IO instead of JSONP
11
Y.YQLRequest.prototype._send = function (url, o) {
12
var req = new XMLHttpRequest(),
15
req.open('GET', url, true);
16
req.onreadystatechange = function () {
17
if (req.readyState === 4) { //Complete
18
//No status code check here, since the YQL service will return JSON
20
//No need to "call" this, YQL handles the context
21
o.on.success(JSON.parse(req.responseText));
26
//Simple timer to catch no connections
27
timer = setTimeout(function() {
29
o.on.timeout('script timeout');
30
}, o.timeout || 30000);