var ajax = new XMLHttpRequest ();
Ajax.open ("Get", "Http://gzmylike.wedei.com/zt/gzyanzhicepin/images/TheLaLaLa.mp3")
Ajax.responsetype = "blob";
Ajax.send ();
ajax.onprogress = function (event) {
if (event.lengthcomputable) {
document.getElementById (' loading '). Style.display = ' None ';
document.getElementById (' Datipage '). style.display = ' block ';
}
}
Ajax.onreadystatechange = function () {
if (ajax.readystate = = 4 && ajax.status = = 200) {
document.getElementById ("AllMusic1"). src = Url.createobjecturl (ajax.response);
var ajax2 = new XMLHttpRequest ();
Ajax2.onreadystatechange = function () {
if (ajax2.readystate = = 4 && ajax2.status = = 200) {
SetTimeout (function () {
document.getElementById (' loading '). Style.display = ' None ';
document.getElementById (' Datipage '). style.display = ' block ';
}, 1000)
}
}
}
}
js-asynchronous Request Audio Completion page display