| 1 |
efrain |
1 |
YUI.add('yql-jsonp', function (Y, NAME) {
|
|
|
2 |
|
|
|
3 |
/**
|
|
|
4 |
* Plugin for YQL to use JSONP to make YQL requests. This is the default method,
|
|
|
5 |
* when loaded in nodejs or winjs this will not load. The new module is needed
|
|
|
6 |
* to make sure that JSONP is not loaded in the environments that it is not needed.
|
|
|
7 |
* @module yql
|
|
|
8 |
* @submodule yql-jsonp
|
|
|
9 |
*/
|
|
|
10 |
|
|
|
11 |
//Over writes Y.YQLRequest._send to use IO instead of JSONP
|
|
|
12 |
Y.YQLRequest.prototype._send = function (url, o) {
|
|
|
13 |
if (o.allowCache !== false) {
|
|
|
14 |
o.allowCache = true;
|
|
|
15 |
}
|
|
|
16 |
if (!this._jsonp) {
|
|
|
17 |
this._jsonp = Y.jsonp(url, o);
|
|
|
18 |
} else {
|
|
|
19 |
this._jsonp.url = url;
|
|
|
20 |
if (o.on && o.on.success) {
|
|
|
21 |
this._jsonp._config.on.success = o.on.success;
|
|
|
22 |
}
|
|
|
23 |
this._jsonp.send();
|
|
|
24 |
}
|
|
|
25 |
};
|
|
|
26 |
|
|
|
27 |
|
|
|
28 |
|
|
|
29 |
}, '3.18.1', {"requires": ["yql", "jsonp", "jsonp-url"]});
|