/ Published in: JavaScript
Use this to enhance non firefox browsers to support the sendAsBinary method.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
XMLHttpRequest.prototype.sendAsBinary = function(datastr) { function byteValue(x) { return x.charCodeAt(0) & 0xff; } var ords = Array.prototype.map.call(datastr, byteValue); var ui8a = new Uint8Array(ords); this.send(ui8a.buffer); }
URL: http://javascript0.org/wiki/Portable_sendAsBinary