vendredi, avril 26, 2013

XMLHttpRequest send binary data


XMLHttpRequest.prototype.binarySend = function(string) {
   var bytes = Array.prototype.map.call(string, function(c) {
     return c.charCodeAt(0) & 0xff;
   });
   this.send(new Uint8Array(bytes).buffer);




Aucun commentaire: