var xmlHttpRequest = new XMLHttpRequest(); xmlHttpRequest.open('GET', url); // XMLHttpRequest2が使えるなら使う isXHR2 = typeof xmlHttpRequest.responseType != 'undefined'; if (isXHR2) { xmlHttpRequest.responseType = 'arraybuffer'; } else { xmlHttpRequest.overrideMimeType( 'text/plain; charset=x-user-defined' ); } xmlHttpRequest.send(null); xmlHttpRequest.onreadystatechange = function() { var readyState = x