Created
February 27, 2010 04:50
-
-
Save miya2000/316483 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //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