Skip to content

Instantly share code, notes, and snippets.

@miya2000
Created February 27, 2010 04:50
Show Gist options
  • Select an option

  • Save miya2000/316483 to your computer and use it in GitHub Desktop.

Select an option

Save miya2000/316483 to your computer and use it in GitHub Desktop.
//at www.google.co.jp on Opera 10.50 Beta (Build 3275)
(function(){
var xhr = new XMLHttpRequest();
xhr.open('GET', 'http://www.google.co.jp/logos/olympics10-shorttrack-hp.png', false);
xhr.overrideMimeType('text/plain; charset=x-user-defined');
xhr.send(null);
//alert(xhr.responseText);
//alert(xhr.responseText.length); // not 0!
//alert(encodeURI(xhr.responseText));
alert(btoa(xhr.responseText));
//alert(btoa(xhr.responseText.replace(/[\u0100-\uffff]/g, function(c){ return String.fromCharCode(c.charCodeAt(0) & 0xff)})));
})()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment