jpg 이미지를 나타내는 바이너리 데이터 스트림 인 httprequest의 응답을 많이 읽은 후에도 여전히 어려움을 겪고 있습니다.자바 스크립트의 httprequest 및 이진 데이터
편집 : 나는 IE8을 사용하고있는 모든 일
xmlhttp = false;
/*@[email protected]*/
/*@if (@_jscript_version >= 5)
// JScript gives us Conditional compilation, we can cope with old IE versions.
// and security blocked creation of the objects.
try {
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
} catch (E) {
xmlhttp = false;
}
}
@[email protected]*/
if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
try {
xmlhttp = new XMLHttpRequest();
} catch (e) {
xmlhttp = false;
}
}
if (!xmlhttp && window.createRequest) {
try {
xmlhttp = window.createRequest();
} catch (e) {
xmlhttp = false;
}
}
xmlhttp.open("GET", theUrl, true);
xmlhttp.onreadystatechange = function() {
if (xmlhttp.readyState == 4) {
var headers = xmlhttp.getAllResponseHeaders();
}
}
xmlhttp.send(null);
하고 (또한 FF12에서 재판)없이 HTML 5 그래서 난 항상
xhr.overrideMimeType('text\/plain; charset=x-user-defined');
나처럼 뭔가 오류와 끝까지
xhr.responseType = "arraybuffer";
변수로 복사해도 작동하지 않습니다.
var body = xhr.response; //.responseText , .responseBody
아이디어가 잘못되었거나 시도 할 수 있습니다.
왜? 무엇을 성취하려고합니까? 서버에서 b64 인코딩을 할 수 있습니까? – mplungjan
아니 임베디드 장치 및 회사는 슬픈 듯이 자신의 인터페이스를 변경하지 않을거야 – Gobliins
그럼 어떻게하면 스크립트 측면에서 바이너리 데이터를 사용하기로되어 있습니까? – Raffaele