Posted By

LEOZAV on 09/11/13


Tagged

sendAsBinary chrom


Versions (?)

sendAsBinary en chrome


 / Published in: JavaScript
 

Ya que la funcion sendAsBinary de FF no funciona en Chrome se implemento esta para

  1. XMLHttpRequest.prototype.sendAsBinary = function(datastr) {
  2. function byteValue(x) {
  3. return x.charCodeAt(0) & 0xff;
  4. }
  5. var ords = Array.prototype.map.call(datastr, byteValue);
  6. var ui8a = new Uint8Array(ords);
  7. this.send(ui8a.buffer);
  8. }

Report this snippet  

You need to login to post a comment.