3 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
4 <title>The source code</title>
5 <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
6 <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
8 <body onload="prettyPrint();">
9 <pre class="prettyprint lang-js">/*!
10 * Ext JS Library 3.2.0
11 * Copyright(c) 2006-2010 Ext JS, Inc.
13 * http://www.extjs.com/license
17 Ext.ux.JSONP = (function(){
20 _nextRequest = function() {
23 _current = _queue.shift();
24 _current.script.src = _current.url + '?' + _current.params;
25 document.getElementsByTagName('head')[0].appendChild(_current.script);
30 request: function(url, o) {
36 o.params = o.params || {};
38 o.params[o.callbackKey] = 'Ext.ux.JSONP.callback';
40 var params = Ext.urlEncode(o.params);
42 var script = document.createElement('script');
43 script.type = 'text/javascript';
47 Ext.fly(script).on('readystatechange', function() {
48 if(script.readyState == 'complete') {
49 var data = script.innerHTML;
51 me.callback(Ext.decode(data));
57 Ext.fly(script).on('load', function() {
58 var data = script.innerHTML;
60 me.callback(Ext.decode(data));
69 callback: o.callback || function(){},
70 scope: o.scope || window,
71 params: params || null
79 callback: function(json) {
80 _current.callback.apply(_current.scope, [json]);
81 Ext.fly(_current.script).removeAllListeners();
82 document.getElementsByTagName('head')[0].removeChild(_current.script);