X-Git-Url: https://scm.cri.mines-paristech.fr/git/Plinn.git/blobdiff_plain/e641a180110f0d30a1a34071addc6eb6d87291ee..7e1385a802cc364f2d36bf32715a589ecc19d215:/skins/ajax_scripts/sarissa.js?ds=sidebyside diff --git a/skins/ajax_scripts/sarissa.js b/skins/ajax_scripts/sarissa.js index 29621a1..880b23b 100644 --- a/skins/ajax_scripts/sarissa.js +++ b/skins/ajax_scripts/sarissa.js @@ -1066,3 +1066,23 @@ Sarissa.setRemoteJsonCallback = function(url, callback, callbackParam) { }; // EOF + +/*\ +|*| +|*| :: XMLHttpRequest.prototype.sendAsBinary() Polifyll :: +|*| +|*| https://developer.mozilla.org/en-US/docs/DOM/XMLHttpRequest#sendAsBinary() +|*| +\*/ + +if (!XMLHttpRequest.prototype.sendAsBinary) { + XMLHttpRequest.prototype.sendAsBinary = function (sData) { + var nBytes = sData.length, ui8Data = new Uint8Array(nBytes); + for (var nIdx = 0; nIdx < nBytes; nIdx++) { + ui8Data[nIdx] = sData.charCodeAt(nIdx) & 0xff; + } + /* send as ArrayBufferView...: */ + this.send(ui8Data); + /* ...or as ArrayBuffer (legacy)...: this.send(ui8Data.buffer); */ + }; +}