I have two identical html files (except for EOL character - one is LF
and the other is CRLF
), which I use to load 2 audio files using XMLHttpRequest
. I don't use any web server (because the purpose is to load it in ipad and run it without any web server) - I just use open those with Safari (for Mac).
The mind-boggling thing is, the file with LF
endlines is able to load the audio files just fine, but the one with CRLF
got:
Cross origin requests error (XMLHttpRequest cannot load file:///directories_to_files/cheer_and_clap.mp3. Cross origin requests are only supported for HTTP.)
You can have a look at the files. I haven't tested on Safari for Windows version yet.
p.loadBuffer = function(url, index) {
var request = new XMLHttpRequest();
console.log(url);
request.open("GET", url, true);
request.responseType = "arraybuffer";
console.log(request);
}
request.onerror = function() {
alert('BufferLoader: XHR error');
}
request.send();
}
Any explanation for why this is happening?
INVALID_STATE_ERR: DOM Exception 11: An attempt was made to use an object that is not, or is no longer, usable.
console.log(request);
does get echoed to the console log tho. – Ouabaindd if=CRLFEOL.html of=CRLFEOL2.html bs=1 skip=3
– Alcina