Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Build io-xdr.

  • Loading branch information...
commit c7facd190a62508b8ebdf46520097ef9ed1e723b 1 parent c38ceab
@ericf ericf authored
View
209 build/io-xdr/io-xdr-coverage.js
@@ -26,11 +26,11 @@ _yuitest_coverage["build/io-xdr/io-xdr.js"] = {
path: "build/io-xdr/io-xdr.js",
code: []
};
-_yuitest_coverage["build/io-xdr/io-xdr.js"].code=["YUI.add('io-xdr', function (Y, NAME) {","","/**","Extends IO to provide an alternate, Flash transport, for making","cross-domain requests.","@module io","@submodule io-xdr","@for IO","**/","","/**","Fires when the XDR transport is ready for use.","@event io:xdrReady","**/","var E_XDR_READY = Y.publish('io:xdrReady', { fireOnce: true }),","","/**","Map of stored configuration objects when using","Flash as the transport for cross-domain requests.","","@property _cB","@private","@type {Object}","**/","_cB = {},","","/**","Map of transaction simulated readyState values","when XDomainRequest is the transport.","","@property _rS","@private","@type {Object}","**/","_rS = {},","","// Document reference","d = Y.config.doc,","// Window reference","w = Y.config.win,","// XDomainRequest cross-origin request detection","xdr = w && w.XDomainRequest;","","/**","Method that creates the Flash transport swf.","","@method _swf","@private","@param {String} uri - location of io.swf.","@param {String} yid - YUI sandbox id.","@param {String} yid - IO instance id.","**/","function _swf(uri, yid, uid) {"," var o = '<object id=\"io_swf\" type=\"application/x-shockwave-flash\" data=\"' +"," uri + '\" width=\"0\" height=\"0\">' +"," '<param name=\"movie\" value=\"' + uri + '\">' +"," '<param name=\"FlashVars\" value=\"yid=' + yid + '&uid=' + uid + '\">' +"," '<param name=\"allowScriptAccess\" value=\"always\">' +"," '</object>',"," c = d.createElement('div');",""," d.body.appendChild(c);"," c.innerHTML = o;","}","","/**","Creates a response object for XDR transactions, for success","and failure cases.","","@method _data","@private","@param {Object} o - Transaction object generated by _create() in io-base.","@param {Boolean} u - Configuration xdr.use.","@param {Boolean} d - Configuration xdr.dataType.","","@return {Object}","**/","function _data(o, u, d) {"," if (u === 'flash') {"," o.c.responseText = decodeURI(o.c.responseText);"," }"," if (d === 'xml') {"," o.c.responseXML = Y.DataType.XML.parse(o.c.responseText);"," }",""," return o;","}","","/**","Method for intiating an XDR transaction abort.","","@method _abort","@private","@param {Object} o - Transaction object generated by _create() in io-base.","@param {Object} c - configuration object for the transaction.","**/","function _abort(o, c) {"," return o.c.abort(o.id, c);","}","","/**","Method for determining if an XDR transaction has completed","and all data are received.","","@method _isInProgress","@private","@param {Object} o - Transaction object generated by _create() in io-base.","**/","function _isInProgress(o) {"," return xdr ? _rS[o.id] !== 4 : o.c.isInProgress(o.id);","}","","Y.mix(Y.IO.prototype, {",""," /**"," Map of io transports.",""," @property _transport"," @private"," @type {Object}"," **/"," _transport: {},",""," /**"," Sets event handlers for XDomainRequest transactions.",""," @method _ieEvt"," @private"," @static"," @param {Object} o - Transaction object generated by _create() in io-base."," @param {Object} c - configuration object for the transaction."," **/"," _ieEvt: function(o, c) {"," var io = this,"," i = o.id,"," t = 'timeout';",""," o.c.onprogress = function() { _rS[i] = 3; };"," o.c.onload = function() {"," _rS[i] = 4;"," io.xdrResponse('success', o, c);"," };"," o.c.onerror = function() {"," _rS[i] = 4;"," io.xdrResponse('failure', o, c);"," };"," if (c[t]) {"," o.c.ontimeout = function() {"," _rS[i] = 4;"," io.xdrResponse(t, o, c);"," };"," o.c[t] = c[t];"," }"," },",""," /**"," Method for accessing the transport's interface for making a"," cross-domain transaction.",""," @method xdr"," @param {String} uri - qualified path to transaction resource."," @param {Object} o - Transaction object generated by _create() in io-base."," @param {Object} c - configuration object for the transaction."," **/"," xdr: function(uri, o, c) {"," var io = this;",""," if (c.xdr.use === 'flash') {"," // The configuration object cannot be serialized safely"," // across Flash's ExternalInterface."," _cB[o.id] = c;"," w.setTimeout(function() {"," try {"," o.c.send(uri, { id: o.id,"," uid: o.uid,"," method: c.method,"," data: c.data,"," headers: c.headers });"," }"," catch(e) {"," io.xdrResponse('transport error', o, c);"," delete _cB[o.id];"," }"," }, Y.io.xdr.delay);"," }"," else if (xdr) {"," io._ieEvt(o, c);"," o.c.open(c.method || 'GET', uri);"," o.c.send(c.data);"," }"," else {"," o.c.send(uri, o, c);"," }",""," return {"," id: o.id,"," abort: function() {"," return o.c ? _abort(o, c) : false;"," },"," isInProgress: function() {"," return o.c ? _isInProgress(o.id) : false;"," },"," io: io"," };"," },",""," /**"," Response controller for cross-domain requests when using the"," Flash transport or IE8's XDomainRequest object.",""," @method xdrResponse"," @param {String} e Event name"," @param {Object} o Transaction object generated by _create() in io-base."," @param {Object} c Configuration object for the transaction."," @return {Object}"," **/"," xdrResponse: function(e, o, c) {"," c = _cB[o.id] ? _cB[o.id] : c;"," var io = this,"," m = xdr ? _rS : _cB,"," u = c.xdr.use,"," d = c.xdr.dataType;",""," switch (e) {"," case 'start':"," io.start(o, c);"," break;"," //case 'complete':"," //This case is not used by Flash or XDomainRequest."," //io.complete(o, c);"," //break;"," case 'success':"," io.success(_data(o, u, d), c);"," delete m[o.id];"," break;"," case 'timeout':"," case 'abort':"," case 'transport error':"," o.c = { status: 0, statusText: e };"," case 'failure':"," io.failure(_data(o, u, d), c);"," delete m[o.id];"," break;"," }"," },",""," /**"," Fires event \"io:xdrReady\"",""," @method _xdrReady"," @private"," @param {Number} yid - YUI sandbox id."," @param {Number} uid - IO instance id."," **/"," _xdrReady: function(yid, uid) {"," Y.fire(E_XDR_READY, yid, uid);"," },",""," /**"," Initializes the desired transport.",""," @method transport"," @param {Object} o - object of transport configurations."," **/"," transport: function(c) {"," if (c.id === 'flash') {"," _swf(Y.UA.ie ? c.src + '?d=' + new Date().valueOf().toString() : c.src, Y.id, c.uid);"," Y.IO.transports.flash = function() { return d.getElementById('io_swf'); };"," }"," }","});","","/**","Fires event \"io:xdrReady\"","","@method xdrReady","@protected","@static","@param {Number} yid - YUI sandbox id.","@param {Number} uid - IO instance id.","**/","Y.io.xdrReady = function(yid, uid){"," var io = Y.io._map[uid];"," Y.io.xdr.delay = 0;"," io._xdrReady.apply(io, [yid, uid]);","};","","Y.io.xdrResponse = function(e, o, c){"," var io = Y.io._map[o.uid];"," io.xdrResponse.apply(io, [e, o, c]);","};","","Y.io.transport = function(c){"," var io = Y.io._map['io:0'] || new Y.IO();"," c.uid = io._uid;"," io.transport.apply(io, [c]);","};","","/**","Delay value to calling the Flash transport, in the","event io.swf has not finished loading. Once the E_XDR_READY","event is fired, this value will be set to 0.","","@property delay","@static","@type {Number}","**/","Y.io.xdr = { delay : 100 };","","","}, '@VERSION@', {\"requires\": [\"io-base\", \"datatype-xml-parse\"]});"];
-_yuitest_coverage["build/io-xdr/io-xdr.js"].lines = {"1":0,"15":0,"53":0,"54":0,"62":0,"63":0,"78":0,"79":0,"80":0,"82":0,"83":0,"86":0,"97":0,"98":0,"109":0,"110":0,"113":0,"134":0,"138":0,"139":0,"140":0,"141":0,"143":0,"144":0,"145":0,"147":0,"148":0,"149":0,"150":0,"152":0,"166":0,"168":0,"171":0,"172":0,"173":0,"174":0,"181":0,"182":0,"186":0,"187":0,"188":0,"189":0,"192":0,"195":0,"198":0,"201":0,"218":0,"219":0,"224":0,"226":0,"227":0,"233":0,"234":0,"235":0,"239":0,"241":0,"242":0,"243":0,"256":0,"266":0,"267":0,"268":0,"282":0,"283":0,"284":0,"285":0,"288":0,"289":0,"290":0,"293":0,"294":0,"295":0,"296":0,"308":0};
-_yuitest_coverage["build/io-xdr/io-xdr.js"].functions = {"_swf:53":0,"_data:78":0,"_abort:97":0,"_isInProgress:109":0,"onprogress:138":0,"onload:139":0,"onerror:143":0,"ontimeout:148":0,"_ieEvt:133":0,"(anonymous 2):172":0,"abort:197":0,"isInProgress:200":0,"xdr:165":0,"xdrResponse:217":0,"_xdrReady:255":0,"flash:268":0,"transport:265":0,"xdrReady:282":0,"xdrResponse:288":0,"transport:293":0,"(anonymous 1):1":0};
+_yuitest_coverage["build/io-xdr/io-xdr.js"].code=["YUI.add('io-xdr', function (Y, NAME) {","","/**","Extends IO to provide an alternate, Flash transport, for making","cross-domain requests.","@module io","@submodule io-xdr","@for IO","**/","","// Helpful resources when working with the mess that is XDomainRequest:","// http://www.cypressnorth.com/blog/web-programming-and-development/internet-explorer-aborting-ajax-requests-fixed/","// http://blogs.msdn.com/b/ieinternals/archive/2010/05/13/xdomainrequest-restrictions-limitations-and-workarounds.aspx","","/**","Fires when the XDR transport is ready for use.","@event io:xdrReady","**/","var E_XDR_READY = Y.publish('io:xdrReady', { fireOnce: true }),","","/**","Map of stored configuration objects when using","Flash as the transport for cross-domain requests.","","@property _cB","@private","@type {Object}","**/","_cB = {},","","/**","Map of transaction simulated readyState values","when XDomainRequest is the transport.","","@property _rS","@private","@type {Object}","**/","_rS = {},","","// Document reference","d = Y.config.doc,","// Window reference","w = Y.config.win,","// XDomainRequest cross-origin request detection","xdr = w && w.XDomainRequest;","","/**","Method that creates the Flash transport swf.","","@method _swf","@private","@param {String} uri - location of io.swf.","@param {String} yid - YUI sandbox id.","@param {String} yid - IO instance id.","**/","function _swf(uri, yid, uid) {"," var o = '<object id=\"io_swf\" type=\"application/x-shockwave-flash\" data=\"' +"," uri + '\" width=\"0\" height=\"0\">' +"," '<param name=\"movie\" value=\"' + uri + '\">' +"," '<param name=\"FlashVars\" value=\"yid=' + yid + '&uid=' + uid + '\">' +"," '<param name=\"allowScriptAccess\" value=\"always\">' +"," '</object>',"," c = d.createElement('div');",""," d.body.appendChild(c);"," c.innerHTML = o;","}","","/**","Creates a response object for XDR transactions, for success","and failure cases.","","@method _data","@private","@param {Object} o - Transaction object generated by _create() in io-base.","@param {Boolean} u - Configuration xdr.use.","@param {Boolean} d - Configuration xdr.dataType.","","@return {Object}","**/","function _data(o, u, d) {"," if (u === 'flash') {"," o.c.responseText = decodeURI(o.c.responseText);"," }"," if (d === 'xml') {"," o.c.responseXML = Y.DataType.XML.parse(o.c.responseText);"," }",""," return o;","}","","/**","Method for intiating an XDR transaction abort.","","@method _abort","@private","@param {Object} o - Transaction object generated by _create() in io-base.","@param {Object} c - configuration object for the transaction.","**/","function _abort(o, c) {"," return o.c.abort(o.id, c);","}","","/**","Method for determining if an XDR transaction has completed","and all data are received.","","@method _isInProgress","@private","@param {Object} o - Transaction object generated by _create() in io-base.","**/","function _isInProgress(o) {"," return xdr ? _rS[o.id] !== 4 : o.c.isInProgress(o.id);","}","","Y.mix(Y.IO.prototype, {",""," /**"," Map of io transports.",""," @property _transport"," @private"," @type {Object}"," **/"," _transport: {},",""," /**"," Sets event handlers for XDomainRequest transactions.",""," @method _ieEvt"," @private"," @static"," @param {Object} o - Transaction object generated by _create() in io-base."," @param {Object} c - configuration object for the transaction."," **/"," _ieEvt: function(o, c) {"," var io = this,"," i = o.id,"," t = 'timeout';",""," o.c.onprogress = function() { _rS[i] = 3; };"," o.c.onload = function() {"," _rS[i] = 4;"," io.xdrResponse('success', o, c);"," };"," o.c.onerror = function() {"," _rS[i] = 4;"," io.xdrResponse('failure', o, c);"," };"," o.c.ontimeout = function() {"," _rS[i] = 4;"," io.xdrResponse(t, o, c);"," };"," o.c[t] = c[t] || 0;"," },",""," /**"," Method for accessing the transport's interface for making a"," cross-domain transaction.",""," @method xdr"," @param {String} uri - qualified path to transaction resource."," @param {Object} o - Transaction object generated by _create() in io-base."," @param {Object} c - configuration object for the transaction."," **/"," xdr: function(uri, o, c) {"," var io = this;",""," if (c.xdr.use === 'flash') {"," // The configuration object cannot be serialized safely"," // across Flash's ExternalInterface."," _cB[o.id] = c;"," w.setTimeout(function() {"," try {"," o.c.send(uri, { id: o.id,"," uid: o.uid,"," method: c.method,"," data: c.data,"," headers: c.headers });"," }"," catch(e) {"," io.xdrResponse('transport error', o, c);"," delete _cB[o.id];"," }"," }, Y.io.xdr.delay);"," }"," else if (xdr) {"," io._ieEvt(o, c);"," o.c.open(c.method || 'GET', uri);",""," // Make async to protect against IE 8 oddities."," setTimeout(function() {"," o.c.send(c.data);"," }, 0);"," }"," else {"," o.c.send(uri, o, c);"," }",""," return {"," id: o.id,"," abort: function() {"," return o.c ? _abort(o, c) : false;"," },"," isInProgress: function() {"," return o.c ? _isInProgress(o.id) : false;"," },"," io: io"," };"," },",""," /**"," Response controller for cross-domain requests when using the"," Flash transport or IE8's XDomainRequest object.",""," @method xdrResponse"," @param {String} e Event name"," @param {Object} o Transaction object generated by _create() in io-base."," @param {Object} c Configuration object for the transaction."," @return {Object}"," **/"," xdrResponse: function(e, o, c) {"," c = _cB[o.id] ? _cB[o.id] : c;"," var io = this,"," m = xdr ? _rS : _cB,"," u = c.xdr.use,"," d = c.xdr.dataType;",""," switch (e) {"," case 'start':"," io.start(o, c);"," break;"," //case 'complete':"," //This case is not used by Flash or XDomainRequest."," //io.complete(o, c);"," //break;"," case 'success':"," io.success(_data(o, u, d), c);"," delete m[o.id];"," break;"," case 'timeout':"," case 'abort':"," case 'transport error':"," o.c = { status: 0, statusText: e };"," case 'failure':"," io.failure(_data(o, u, d), c);"," delete m[o.id];"," break;"," }"," },",""," /**"," Fires event \"io:xdrReady\"",""," @method _xdrReady"," @private"," @param {Number} yid - YUI sandbox id."," @param {Number} uid - IO instance id."," **/"," _xdrReady: function(yid, uid) {"," Y.fire(E_XDR_READY, yid, uid);"," },",""," /**"," Initializes the desired transport.",""," @method transport"," @param {Object} o - object of transport configurations."," **/"," transport: function(c) {"," if (c.id === 'flash') {"," _swf(Y.UA.ie ? c.src + '?d=' + new Date().valueOf().toString() : c.src, Y.id, c.uid);"," Y.IO.transports.flash = function() { return d.getElementById('io_swf'); };"," }"," }","});","","/**","Fires event \"io:xdrReady\"","","@method xdrReady","@protected","@static","@param {Number} yid - YUI sandbox id.","@param {Number} uid - IO instance id.","**/","Y.io.xdrReady = function(yid, uid){"," var io = Y.io._map[uid];"," Y.io.xdr.delay = 0;"," io._xdrReady.apply(io, [yid, uid]);","};","","Y.io.xdrResponse = function(e, o, c){"," var io = Y.io._map[o.uid];"," io.xdrResponse.apply(io, [e, o, c]);","};","","Y.io.transport = function(c){"," var io = Y.io._map['io:0'] || new Y.IO();"," c.uid = io._uid;"," io.transport.apply(io, [c]);","};","","/**","Delay value to calling the Flash transport, in the","event io.swf has not finished loading. Once the E_XDR_READY","event is fired, this value will be set to 0.","","@property delay","@static","@type {Number}","**/","Y.io.xdr = { delay : 100 };","","","}, '@VERSION@', {\"requires\": [\"io-base\", \"datatype-xml-parse\"]});"];
+_yuitest_coverage["build/io-xdr/io-xdr.js"].lines = {"1":0,"19":0,"57":0,"58":0,"66":0,"67":0,"82":0,"83":0,"84":0,"86":0,"87":0,"90":0,"101":0,"102":0,"113":0,"114":0,"117":0,"138":0,"142":0,"143":0,"144":0,"145":0,"147":0,"148":0,"149":0,"151":0,"152":0,"153":0,"155":0,"168":0,"170":0,"173":0,"174":0,"175":0,"176":0,"183":0,"184":0,"188":0,"189":0,"190":0,"193":0,"194":0,"198":0,"201":0,"204":0,"207":0,"224":0,"225":0,"230":0,"232":0,"233":0,"239":0,"240":0,"241":0,"245":0,"247":0,"248":0,"249":0,"262":0,"272":0,"273":0,"274":0,"288":0,"289":0,"290":0,"291":0,"294":0,"295":0,"296":0,"299":0,"300":0,"301":0,"302":0,"314":0};
+_yuitest_coverage["build/io-xdr/io-xdr.js"].functions = {"_swf:57":0,"_data:82":0,"_abort:101":0,"_isInProgress:113":0,"onprogress:142":0,"onload:143":0,"onerror:147":0,"ontimeout:151":0,"_ieEvt:137":0,"(anonymous 2):174":0,"(anonymous 3):193":0,"abort:203":0,"isInProgress:206":0,"xdr:167":0,"xdrResponse:223":0,"_xdrReady:261":0,"flash:274":0,"transport:271":0,"xdrReady:288":0,"xdrResponse:294":0,"transport:299":0,"(anonymous 1):1":0};
_yuitest_coverage["build/io-xdr/io-xdr.js"].coveredLines = 74;
-_yuitest_coverage["build/io-xdr/io-xdr.js"].coveredFunctions = 21;
+_yuitest_coverage["build/io-xdr/io-xdr.js"].coveredFunctions = 22;
_yuitest_coverline("build/io-xdr/io-xdr.js", 1);
YUI.add('io-xdr', function (Y, NAME) {
@@ -42,12 +42,16 @@ cross-domain requests.
@for IO
**/
+// Helpful resources when working with the mess that is XDomainRequest:
+// http://www.cypressnorth.com/blog/web-programming-and-development/internet-explorer-aborting-ajax-requests-fixed/
+// http://blogs.msdn.com/b/ieinternals/archive/2010/05/13/xdomainrequest-restrictions-limitations-and-workarounds.aspx
+
/**
Fires when the XDR transport is ready for use.
@event io:xdrReady
**/
_yuitest_coverfunc("build/io-xdr/io-xdr.js", "(anonymous 1)", 1);
-_yuitest_coverline("build/io-xdr/io-xdr.js", 15);
+_yuitest_coverline("build/io-xdr/io-xdr.js", 19);
var E_XDR_READY = Y.publish('io:xdrReady', { fireOnce: true }),
/**
@@ -86,10 +90,10 @@ Method that creates the Flash transport swf.
@param {String} yid - YUI sandbox id.
@param {String} yid - IO instance id.
**/
-_yuitest_coverline("build/io-xdr/io-xdr.js", 53);
+_yuitest_coverline("build/io-xdr/io-xdr.js", 57);
function _swf(uri, yid, uid) {
- _yuitest_coverfunc("build/io-xdr/io-xdr.js", "_swf", 53);
-_yuitest_coverline("build/io-xdr/io-xdr.js", 54);
+ _yuitest_coverfunc("build/io-xdr/io-xdr.js", "_swf", 57);
+_yuitest_coverline("build/io-xdr/io-xdr.js", 58);
var o = '<object id="io_swf" type="application/x-shockwave-flash" data="' +
uri + '" width="0" height="0">' +
'<param name="movie" value="' + uri + '">' +
@@ -98,9 +102,9 @@ var o = '<object id="io_swf" type="application/x-shockwave-flash" data="' +
'</object>',
c = d.createElement('div');
- _yuitest_coverline("build/io-xdr/io-xdr.js", 62);
+ _yuitest_coverline("build/io-xdr/io-xdr.js", 66);
d.body.appendChild(c);
- _yuitest_coverline("build/io-xdr/io-xdr.js", 63);
+ _yuitest_coverline("build/io-xdr/io-xdr.js", 67);
c.innerHTML = o;
}
@@ -116,21 +120,21 @@ and failure cases.
@return {Object}
**/
-_yuitest_coverline("build/io-xdr/io-xdr.js", 78);
+_yuitest_coverline("build/io-xdr/io-xdr.js", 82);
function _data(o, u, d) {
- _yuitest_coverfunc("build/io-xdr/io-xdr.js", "_data", 78);
-_yuitest_coverline("build/io-xdr/io-xdr.js", 79);
+ _yuitest_coverfunc("build/io-xdr/io-xdr.js", "_data", 82);
+_yuitest_coverline("build/io-xdr/io-xdr.js", 83);
if (u === 'flash') {
- _yuitest_coverline("build/io-xdr/io-xdr.js", 80);
+ _yuitest_coverline("build/io-xdr/io-xdr.js", 84);
o.c.responseText = decodeURI(o.c.responseText);
}
- _yuitest_coverline("build/io-xdr/io-xdr.js", 82);
+ _yuitest_coverline("build/io-xdr/io-xdr.js", 86);
if (d === 'xml') {
- _yuitest_coverline("build/io-xdr/io-xdr.js", 83);
+ _yuitest_coverline("build/io-xdr/io-xdr.js", 87);
o.c.responseXML = Y.DataType.XML.parse(o.c.responseText);
}
- _yuitest_coverline("build/io-xdr/io-xdr.js", 86);
+ _yuitest_coverline("build/io-xdr/io-xdr.js", 90);
return o;
}
@@ -142,10 +146,10 @@ Method for intiating an XDR transaction abort.
@param {Object} o - Transaction object generated by _create() in io-base.
@param {Object} c - configuration object for the transaction.
**/
-_yuitest_coverline("build/io-xdr/io-xdr.js", 97);
+_yuitest_coverline("build/io-xdr/io-xdr.js", 101);
function _abort(o, c) {
- _yuitest_coverfunc("build/io-xdr/io-xdr.js", "_abort", 97);
-_yuitest_coverline("build/io-xdr/io-xdr.js", 98);
+ _yuitest_coverfunc("build/io-xdr/io-xdr.js", "_abort", 101);
+_yuitest_coverline("build/io-xdr/io-xdr.js", 102);
return o.c.abort(o.id, c);
}
@@ -157,14 +161,14 @@ and all data are received.
@private
@param {Object} o - Transaction object generated by _create() in io-base.
**/
-_yuitest_coverline("build/io-xdr/io-xdr.js", 109);
+_yuitest_coverline("build/io-xdr/io-xdr.js", 113);
function _isInProgress(o) {
- _yuitest_coverfunc("build/io-xdr/io-xdr.js", "_isInProgress", 109);
-_yuitest_coverline("build/io-xdr/io-xdr.js", 110);
+ _yuitest_coverfunc("build/io-xdr/io-xdr.js", "_isInProgress", 113);
+_yuitest_coverline("build/io-xdr/io-xdr.js", 114);
return xdr ? _rS[o.id] !== 4 : o.c.isInProgress(o.id);
}
-_yuitest_coverline("build/io-xdr/io-xdr.js", 113);
+_yuitest_coverline("build/io-xdr/io-xdr.js", 117);
Y.mix(Y.IO.prototype, {
/**
@@ -186,44 +190,41 @@ Y.mix(Y.IO.prototype, {
@param {Object} c - configuration object for the transaction.
**/
_ieEvt: function(o, c) {
- _yuitest_coverfunc("build/io-xdr/io-xdr.js", "_ieEvt", 133);
-_yuitest_coverline("build/io-xdr/io-xdr.js", 134);
+ _yuitest_coverfunc("build/io-xdr/io-xdr.js", "_ieEvt", 137);
+_yuitest_coverline("build/io-xdr/io-xdr.js", 138);
var io = this,
i = o.id,
t = 'timeout';
- _yuitest_coverline("build/io-xdr/io-xdr.js", 138);
-o.c.onprogress = function() { _yuitest_coverfunc("build/io-xdr/io-xdr.js", "onprogress", 138);
+ _yuitest_coverline("build/io-xdr/io-xdr.js", 142);
+o.c.onprogress = function() { _yuitest_coverfunc("build/io-xdr/io-xdr.js", "onprogress", 142);
_rS[i] = 3; };
- _yuitest_coverline("build/io-xdr/io-xdr.js", 139);
+ _yuitest_coverline("build/io-xdr/io-xdr.js", 143);
o.c.onload = function() {
- _yuitest_coverfunc("build/io-xdr/io-xdr.js", "onload", 139);
-_yuitest_coverline("build/io-xdr/io-xdr.js", 140);
+ _yuitest_coverfunc("build/io-xdr/io-xdr.js", "onload", 143);
+_yuitest_coverline("build/io-xdr/io-xdr.js", 144);
_rS[i] = 4;
- _yuitest_coverline("build/io-xdr/io-xdr.js", 141);
+ _yuitest_coverline("build/io-xdr/io-xdr.js", 145);
io.xdrResponse('success', o, c);
};
- _yuitest_coverline("build/io-xdr/io-xdr.js", 143);
+ _yuitest_coverline("build/io-xdr/io-xdr.js", 147);
o.c.onerror = function() {
- _yuitest_coverfunc("build/io-xdr/io-xdr.js", "onerror", 143);
-_yuitest_coverline("build/io-xdr/io-xdr.js", 144);
+ _yuitest_coverfunc("build/io-xdr/io-xdr.js", "onerror", 147);
+_yuitest_coverline("build/io-xdr/io-xdr.js", 148);
_rS[i] = 4;
- _yuitest_coverline("build/io-xdr/io-xdr.js", 145);
+ _yuitest_coverline("build/io-xdr/io-xdr.js", 149);
io.xdrResponse('failure', o, c);
};
- _yuitest_coverline("build/io-xdr/io-xdr.js", 147);
-if (c[t]) {
- _yuitest_coverline("build/io-xdr/io-xdr.js", 148);
+ _yuitest_coverline("build/io-xdr/io-xdr.js", 151);
o.c.ontimeout = function() {
- _yuitest_coverfunc("build/io-xdr/io-xdr.js", "ontimeout", 148);
-_yuitest_coverline("build/io-xdr/io-xdr.js", 149);
+ _yuitest_coverfunc("build/io-xdr/io-xdr.js", "ontimeout", 151);
+_yuitest_coverline("build/io-xdr/io-xdr.js", 152);
_rS[i] = 4;
- _yuitest_coverline("build/io-xdr/io-xdr.js", 150);
+ _yuitest_coverline("build/io-xdr/io-xdr.js", 153);
io.xdrResponse(t, o, c);
- };
- _yuitest_coverline("build/io-xdr/io-xdr.js", 152);
-o.c[t] = c[t];
- }
+ };
+ _yuitest_coverline("build/io-xdr/io-xdr.js", 155);
+o.c[t] = c[t] || 0;
},
/**
@@ -236,22 +237,22 @@ o.c[t] = c[t];
@param {Object} c - configuration object for the transaction.
**/
xdr: function(uri, o, c) {
- _yuitest_coverfunc("build/io-xdr/io-xdr.js", "xdr", 165);
-_yuitest_coverline("build/io-xdr/io-xdr.js", 166);
+ _yuitest_coverfunc("build/io-xdr/io-xdr.js", "xdr", 167);
+_yuitest_coverline("build/io-xdr/io-xdr.js", 168);
var io = this;
- _yuitest_coverline("build/io-xdr/io-xdr.js", 168);
+ _yuitest_coverline("build/io-xdr/io-xdr.js", 170);
if (c.xdr.use === 'flash') {
// The configuration object cannot be serialized safely
// across Flash's ExternalInterface.
- _yuitest_coverline("build/io-xdr/io-xdr.js", 171);
+ _yuitest_coverline("build/io-xdr/io-xdr.js", 173);
_cB[o.id] = c;
- _yuitest_coverline("build/io-xdr/io-xdr.js", 172);
+ _yuitest_coverline("build/io-xdr/io-xdr.js", 174);
w.setTimeout(function() {
- _yuitest_coverfunc("build/io-xdr/io-xdr.js", "(anonymous 2)", 172);
-_yuitest_coverline("build/io-xdr/io-xdr.js", 173);
+ _yuitest_coverfunc("build/io-xdr/io-xdr.js", "(anonymous 2)", 174);
+_yuitest_coverline("build/io-xdr/io-xdr.js", 175);
try {
- _yuitest_coverline("build/io-xdr/io-xdr.js", 174);
+ _yuitest_coverline("build/io-xdr/io-xdr.js", 176);
o.c.send(uri, { id: o.id,
uid: o.uid,
method: c.method,
@@ -259,38 +260,44 @@ o.c.send(uri, { id: o.id,
headers: c.headers });
}
catch(e) {
- _yuitest_coverline("build/io-xdr/io-xdr.js", 181);
+ _yuitest_coverline("build/io-xdr/io-xdr.js", 183);
io.xdrResponse('transport error', o, c);
- _yuitest_coverline("build/io-xdr/io-xdr.js", 182);
+ _yuitest_coverline("build/io-xdr/io-xdr.js", 184);
delete _cB[o.id];
}
}, Y.io.xdr.delay);
}
- else {_yuitest_coverline("build/io-xdr/io-xdr.js", 186);
+ else {_yuitest_coverline("build/io-xdr/io-xdr.js", 188);
if (xdr) {
- _yuitest_coverline("build/io-xdr/io-xdr.js", 187);
+ _yuitest_coverline("build/io-xdr/io-xdr.js", 189);
io._ieEvt(o, c);
- _yuitest_coverline("build/io-xdr/io-xdr.js", 188);
+ _yuitest_coverline("build/io-xdr/io-xdr.js", 190);
o.c.open(c.method || 'GET', uri);
- _yuitest_coverline("build/io-xdr/io-xdr.js", 189);
+
+ // Make async to protect against IE 8 oddities.
+ _yuitest_coverline("build/io-xdr/io-xdr.js", 193);
+setTimeout(function() {
+ _yuitest_coverfunc("build/io-xdr/io-xdr.js", "(anonymous 3)", 193);
+_yuitest_coverline("build/io-xdr/io-xdr.js", 194);
o.c.send(c.data);
+ }, 0);
}
else {
- _yuitest_coverline("build/io-xdr/io-xdr.js", 192);
+ _yuitest_coverline("build/io-xdr/io-xdr.js", 198);
o.c.send(uri, o, c);
}}
- _yuitest_coverline("build/io-xdr/io-xdr.js", 195);
+ _yuitest_coverline("build/io-xdr/io-xdr.js", 201);
return {
id: o.id,
abort: function() {
- _yuitest_coverfunc("build/io-xdr/io-xdr.js", "abort", 197);
-_yuitest_coverline("build/io-xdr/io-xdr.js", 198);
+ _yuitest_coverfunc("build/io-xdr/io-xdr.js", "abort", 203);
+_yuitest_coverline("build/io-xdr/io-xdr.js", 204);
return o.c ? _abort(o, c) : false;
},
isInProgress: function() {
- _yuitest_coverfunc("build/io-xdr/io-xdr.js", "isInProgress", 200);
-_yuitest_coverline("build/io-xdr/io-xdr.js", 201);
+ _yuitest_coverfunc("build/io-xdr/io-xdr.js", "isInProgress", 206);
+_yuitest_coverline("build/io-xdr/io-xdr.js", 207);
return o.c ? _isInProgress(o.id) : false;
},
io: io
@@ -308,44 +315,44 @@ return o.c ? _isInProgress(o.id) : false;
@return {Object}
**/
xdrResponse: function(e, o, c) {
- _yuitest_coverfunc("build/io-xdr/io-xdr.js", "xdrResponse", 217);
-_yuitest_coverline("build/io-xdr/io-xdr.js", 218);
+ _yuitest_coverfunc("build/io-xdr/io-xdr.js", "xdrResponse", 223);
+_yuitest_coverline("build/io-xdr/io-xdr.js", 224);
c = _cB[o.id] ? _cB[o.id] : c;
- _yuitest_coverline("build/io-xdr/io-xdr.js", 219);
+ _yuitest_coverline("build/io-xdr/io-xdr.js", 225);
var io = this,
m = xdr ? _rS : _cB,
u = c.xdr.use,
d = c.xdr.dataType;
- _yuitest_coverline("build/io-xdr/io-xdr.js", 224);
+ _yuitest_coverline("build/io-xdr/io-xdr.js", 230);
switch (e) {
case 'start':
- _yuitest_coverline("build/io-xdr/io-xdr.js", 226);
+ _yuitest_coverline("build/io-xdr/io-xdr.js", 232);
io.start(o, c);
- _yuitest_coverline("build/io-xdr/io-xdr.js", 227);
+ _yuitest_coverline("build/io-xdr/io-xdr.js", 233);
break;
//case 'complete':
//This case is not used by Flash or XDomainRequest.
//io.complete(o, c);
//break;
case 'success':
- _yuitest_coverline("build/io-xdr/io-xdr.js", 233);
+ _yuitest_coverline("build/io-xdr/io-xdr.js", 239);
io.success(_data(o, u, d), c);
- _yuitest_coverline("build/io-xdr/io-xdr.js", 234);
+ _yuitest_coverline("build/io-xdr/io-xdr.js", 240);
delete m[o.id];
- _yuitest_coverline("build/io-xdr/io-xdr.js", 235);
+ _yuitest_coverline("build/io-xdr/io-xdr.js", 241);
break;
case 'timeout':
case 'abort':
case 'transport error':
- _yuitest_coverline("build/io-xdr/io-xdr.js", 239);
+ _yuitest_coverline("build/io-xdr/io-xdr.js", 245);
o.c = { status: 0, statusText: e };
case 'failure':
- _yuitest_coverline("build/io-xdr/io-xdr.js", 241);
+ _yuitest_coverline("build/io-xdr/io-xdr.js", 247);
io.failure(_data(o, u, d), c);
- _yuitest_coverline("build/io-xdr/io-xdr.js", 242);
+ _yuitest_coverline("build/io-xdr/io-xdr.js", 248);
delete m[o.id];
- _yuitest_coverline("build/io-xdr/io-xdr.js", 243);
+ _yuitest_coverline("build/io-xdr/io-xdr.js", 249);
break;
}
},
@@ -359,8 +366,8 @@ break;
@param {Number} uid - IO instance id.
**/
_xdrReady: function(yid, uid) {
- _yuitest_coverfunc("build/io-xdr/io-xdr.js", "_xdrReady", 255);
-_yuitest_coverline("build/io-xdr/io-xdr.js", 256);
+ _yuitest_coverfunc("build/io-xdr/io-xdr.js", "_xdrReady", 261);
+_yuitest_coverline("build/io-xdr/io-xdr.js", 262);
Y.fire(E_XDR_READY, yid, uid);
},
@@ -371,13 +378,13 @@ Y.fire(E_XDR_READY, yid, uid);
@param {Object} o - object of transport configurations.
**/
transport: function(c) {
- _yuitest_coverfunc("build/io-xdr/io-xdr.js", "transport", 265);
-_yuitest_coverline("build/io-xdr/io-xdr.js", 266);
+ _yuitest_coverfunc("build/io-xdr/io-xdr.js", "transport", 271);
+_yuitest_coverline("build/io-xdr/io-xdr.js", 272);
if (c.id === 'flash') {
- _yuitest_coverline("build/io-xdr/io-xdr.js", 267);
+ _yuitest_coverline("build/io-xdr/io-xdr.js", 273);
_swf(Y.UA.ie ? c.src + '?d=' + new Date().valueOf().toString() : c.src, Y.id, c.uid);
- _yuitest_coverline("build/io-xdr/io-xdr.js", 268);
-Y.IO.transports.flash = function() { _yuitest_coverfunc("build/io-xdr/io-xdr.js", "flash", 268);
+ _yuitest_coverline("build/io-xdr/io-xdr.js", 274);
+Y.IO.transports.flash = function() { _yuitest_coverfunc("build/io-xdr/io-xdr.js", "flash", 274);
return d.getElementById('io_swf'); };
}
}
@@ -392,34 +399,34 @@ Fires event "io:xdrReady"
@param {Number} yid - YUI sandbox id.
@param {Number} uid - IO instance id.
**/
-_yuitest_coverline("build/io-xdr/io-xdr.js", 282);
+_yuitest_coverline("build/io-xdr/io-xdr.js", 288);
Y.io.xdrReady = function(yid, uid){
- _yuitest_coverfunc("build/io-xdr/io-xdr.js", "xdrReady", 282);
-_yuitest_coverline("build/io-xdr/io-xdr.js", 283);
+ _yuitest_coverfunc("build/io-xdr/io-xdr.js", "xdrReady", 288);
+_yuitest_coverline("build/io-xdr/io-xdr.js", 289);
var io = Y.io._map[uid];
- _yuitest_coverline("build/io-xdr/io-xdr.js", 284);
+ _yuitest_coverline("build/io-xdr/io-xdr.js", 290);
Y.io.xdr.delay = 0;
- _yuitest_coverline("build/io-xdr/io-xdr.js", 285);
+ _yuitest_coverline("build/io-xdr/io-xdr.js", 291);
io._xdrReady.apply(io, [yid, uid]);
};
-_yuitest_coverline("build/io-xdr/io-xdr.js", 288);
+_yuitest_coverline("build/io-xdr/io-xdr.js", 294);
Y.io.xdrResponse = function(e, o, c){
- _yuitest_coverfunc("build/io-xdr/io-xdr.js", "xdrResponse", 288);
-_yuitest_coverline("build/io-xdr/io-xdr.js", 289);
+ _yuitest_coverfunc("build/io-xdr/io-xdr.js", "xdrResponse", 294);
+_yuitest_coverline("build/io-xdr/io-xdr.js", 295);
var io = Y.io._map[o.uid];
- _yuitest_coverline("build/io-xdr/io-xdr.js", 290);
+ _yuitest_coverline("build/io-xdr/io-xdr.js", 296);
io.xdrResponse.apply(io, [e, o, c]);
};
-_yuitest_coverline("build/io-xdr/io-xdr.js", 293);
+_yuitest_coverline("build/io-xdr/io-xdr.js", 299);
Y.io.transport = function(c){
- _yuitest_coverfunc("build/io-xdr/io-xdr.js", "transport", 293);
-_yuitest_coverline("build/io-xdr/io-xdr.js", 294);
+ _yuitest_coverfunc("build/io-xdr/io-xdr.js", "transport", 299);
+_yuitest_coverline("build/io-xdr/io-xdr.js", 300);
var io = Y.io._map['io:0'] || new Y.IO();
- _yuitest_coverline("build/io-xdr/io-xdr.js", 295);
+ _yuitest_coverline("build/io-xdr/io-xdr.js", 301);
c.uid = io._uid;
- _yuitest_coverline("build/io-xdr/io-xdr.js", 296);
+ _yuitest_coverline("build/io-xdr/io-xdr.js", 302);
io.transport.apply(io, [c]);
};
@@ -432,7 +439,7 @@ event is fired, this value will be set to 0.
@static
@type {Number}
**/
-_yuitest_coverline("build/io-xdr/io-xdr.js", 308);
+_yuitest_coverline("build/io-xdr/io-xdr.js", 314);
Y.io.xdr = { delay : 100 };
View
22 build/io-xdr/io-xdr-debug.js
@@ -8,6 +8,10 @@ cross-domain requests.
@for IO
**/
+// Helpful resources when working with the mess that is XDomainRequest:
+// http://www.cypressnorth.com/blog/web-programming-and-development/internet-explorer-aborting-ajax-requests-fixed/
+// http://blogs.msdn.com/b/ieinternals/archive/2010/05/13/xdomainrequest-restrictions-limitations-and-workarounds.aspx
+
/**
Fires when the XDR transport is ready for use.
@event io:xdrReady
@@ -144,13 +148,11 @@ Y.mix(Y.IO.prototype, {
_rS[i] = 4;
io.xdrResponse('failure', o, c);
};
- if (c[t]) {
- o.c.ontimeout = function() {
- _rS[i] = 4;
- io.xdrResponse(t, o, c);
- };
- o.c[t] = c[t];
- }
+ o.c.ontimeout = function() {
+ _rS[i] = 4;
+ io.xdrResponse(t, o, c);
+ };
+ o.c[t] = c[t] || 0;
},
/**
@@ -186,7 +188,11 @@ Y.mix(Y.IO.prototype, {
else if (xdr) {
io._ieEvt(o, c);
o.c.open(c.method || 'GET', uri);
- o.c.send(c.data);
+
+ // Make async to protect against IE 8 oddities.
+ setTimeout(function() {
+ o.c.send(c.data);
+ }, 0);
}
else {
o.c.send(uri, o, c);
View
2  build/io-xdr/io-xdr-min.js
@@ -1 +1 @@
-YUI.add("io-xdr",function(e,t){function a(e,t,n){var r='<object id="io_swf" type="application/x-shockwave-flash" data="'+e+'" width="0" height="0">'+'<param name="movie" value="'+e+'">'+'<param name="FlashVars" value="yid='+t+"&uid="+n+'">'+'<param name="allowScriptAccess" value="always">'+"</object>",i=s.createElement("div");s.body.appendChild(i),i.innerHTML=r}function f(t,n,r){return n==="flash"&&(t.c.responseText=decodeURI(t.c.responseText)),r==="xml"&&(t.c.responseXML=e.DataType.XML.parse(t.c.responseText)),t}function l(e,t){return e.c.abort(e.id,t)}function c(e){return u?i[e.id]!==4:e.c.isInProgress(e.id)}var n=e.publish("io:xdrReady",{fireOnce:!0}),r={},i={},s=e.config.doc,o=e.config.win,u=o&&o.XDomainRequest;e.mix(e.IO.prototype,{_transport:{},_ieEvt:function(e,t){var n=this,r=e.id,s="timeout";e.c.onprogress=function(){i[r]=3},e.c.onload=function(){i[r]=4,n.xdrResponse("success",e,t)},e.c.onerror=function(){i[r]=4,n.xdrResponse("failure",e,t)},t[s]&&(e.c.ontimeout=function(){i[r]=4,n.xdrResponse(s,e,t)},e.c[s]=t[s])},xdr:function(t,n,i){var s=this;return i.xdr.use==="flash"?(r[n.id]=i,o.setTimeout(function(){try{n.c.send(t,{id:n.id,uid:n.uid,method:i.method,data:i.data,headers:i.headers})}catch(e){s.xdrResponse("transport error",n,i),delete r[n.id]}},e.io.xdr.delay)):u?(s._ieEvt(n,i),n.c.open(i.method||"GET",t),n.c.send(i.data)):n.c.send(t,n,i),{id:n.id,abort:function(){return n.c?l(n,i):!1},isInProgress:function(){return n.c?c(n.id):!1},io:s}},xdrResponse:function(e,t,n){n=r[t.id]?r[t.id]:n;var s=this,o=u?i:r,a=n.xdr.use,l=n.xdr.dataType;switch(e){case"start":s.start(t,n);break;case"success":s.success(f(t,a,l),n),delete o[t.id];break;case"timeout":case"abort":case"transport error":t.c={status:0,statusText:e};case"failure":s.failure(f(t,a,l),n),delete o[t.id]}},_xdrReady:function(t,r){e.fire(n,t,r)},transport:function(t){t.id==="flash"&&(a(e.UA.ie?t.src+"?d="+(new Date).valueOf().toString():t.src,e.id,t.uid),e.IO.transports.flash=function(){return s.getElementById("io_swf")})}}),e.io.xdrReady=function(t,n){var r=e.io._map[n];e.io.xdr.delay=0,r._xdrReady.apply(r,[t,n])},e.io.xdrResponse=function(t,n,r){var i=e.io._map[n.uid];i.xdrResponse.apply(i,[t,n,r])},e.io.transport=function(t){var n=e.io._map["io:0"]||new e.IO;t.uid=n._uid,n.transport.apply(n,[t])},e.io.xdr={delay:100}},"@VERSION@",{requires:["io-base","datatype-xml-parse"]});
+YUI.add("io-xdr",function(e,t){function a(e,t,n){var r='<object id="io_swf" type="application/x-shockwave-flash" data="'+e+'" width="0" height="0">'+'<param name="movie" value="'+e+'">'+'<param name="FlashVars" value="yid='+t+"&uid="+n+'">'+'<param name="allowScriptAccess" value="always">'+"</object>",i=s.createElement("div");s.body.appendChild(i),i.innerHTML=r}function f(t,n,r){return n==="flash"&&(t.c.responseText=decodeURI(t.c.responseText)),r==="xml"&&(t.c.responseXML=e.DataType.XML.parse(t.c.responseText)),t}function l(e,t){return e.c.abort(e.id,t)}function c(e){return u?i[e.id]!==4:e.c.isInProgress(e.id)}var n=e.publish("io:xdrReady",{fireOnce:!0}),r={},i={},s=e.config.doc,o=e.config.win,u=o&&o.XDomainRequest;e.mix(e.IO.prototype,{_transport:{},_ieEvt:function(e,t){var n=this,r=e.id,s="timeout";e.c.onprogress=function(){i[r]=3},e.c.onload=function(){i[r]=4,n.xdrResponse("success",e,t)},e.c.onerror=function(){i[r]=4,n.xdrResponse("failure",e,t)},e.c.ontimeout=function(){i[r]=4,n.xdrResponse(s,e,t)},e.c[s]=t[s]||0},xdr:function(t,n,i){var s=this;return i.xdr.use==="flash"?(r[n.id]=i,o.setTimeout(function(){try{n.c.send(t,{id:n.id,uid:n.uid,method:i.method,data:i.data,headers:i.headers})}catch(e){s.xdrResponse("transport error",n,i),delete r[n.id]}},e.io.xdr.delay)):u?(s._ieEvt(n,i),n.c.open(i.method||"GET",t),setTimeout(function(){n.c.send(i.data)},0)):n.c.send(t,n,i),{id:n.id,abort:function(){return n.c?l(n,i):!1},isInProgress:function(){return n.c?c(n.id):!1},io:s}},xdrResponse:function(e,t,n){n=r[t.id]?r[t.id]:n;var s=this,o=u?i:r,a=n.xdr.use,l=n.xdr.dataType;switch(e){case"start":s.start(t,n);break;case"success":s.success(f(t,a,l),n),delete o[t.id];break;case"timeout":case"abort":case"transport error":t.c={status:0,statusText:e};case"failure":s.failure(f(t,a,l),n),delete o[t.id]}},_xdrReady:function(t,r){e.fire(n,t,r)},transport:function(t){t.id==="flash"&&(a(e.UA.ie?t.src+"?d="+(new Date).valueOf().toString():t.src,e.id,t.uid),e.IO.transports.flash=function(){return s.getElementById("io_swf")})}}),e.io.xdrReady=function(t,n){var r=e.io._map[n];e.io.xdr.delay=0,r._xdrReady.apply(r,[t,n])},e.io.xdrResponse=function(t,n,r){var i=e.io._map[n.uid];i.xdrResponse.apply(i,[t,n,r])},e.io.transport=function(t){var n=e.io._map["io:0"]||new e.IO;t.uid=n._uid,n.transport.apply(n,[t])},e.io.xdr={delay:100}},"@VERSION@",{requires:["io-base","datatype-xml-parse"]});
View
22 build/io-xdr/io-xdr.js
@@ -8,6 +8,10 @@ cross-domain requests.
@for IO
**/
+// Helpful resources when working with the mess that is XDomainRequest:
+// http://www.cypressnorth.com/blog/web-programming-and-development/internet-explorer-aborting-ajax-requests-fixed/
+// http://blogs.msdn.com/b/ieinternals/archive/2010/05/13/xdomainrequest-restrictions-limitations-and-workarounds.aspx
+
/**
Fires when the XDR transport is ready for use.
@event io:xdrReady
@@ -144,13 +148,11 @@ Y.mix(Y.IO.prototype, {
_rS[i] = 4;
io.xdrResponse('failure', o, c);
};
- if (c[t]) {
- o.c.ontimeout = function() {
- _rS[i] = 4;
- io.xdrResponse(t, o, c);
- };
- o.c[t] = c[t];
- }
+ o.c.ontimeout = function() {
+ _rS[i] = 4;
+ io.xdrResponse(t, o, c);
+ };
+ o.c[t] = c[t] || 0;
},
/**
@@ -186,7 +188,11 @@ Y.mix(Y.IO.prototype, {
else if (xdr) {
io._ieEvt(o, c);
o.c.open(c.method || 'GET', uri);
- o.c.send(c.data);
+
+ // Make async to protect against IE 8 oddities.
+ setTimeout(function() {
+ o.c.send(c.data);
+ }, 0);
}
else {
o.c.send(uri, o, c);
Please sign in to comment.
Something went wrong with that request. Please try again.