var xhr = new XMLHttpRequest; xhr.responseType = 'blob'; xhr.open(method, url); xhr.onloadend = function() { var fr = new FileReader; fr.onloadend = callback.bind(fr, fr.result); fr.readAsText(xhr.response, encoding); }; xhr.send(params); Register as a new user and use Qiita more conveniently You get articles that match your needsYou can efficiently read back useful informationYou can use dark the