sendAsBinary en chrome


/ Published in: JavaScript
Save to your folder(s)

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


Copy this code and paste it in your HTML
  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


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.