Commit 6930db73 by agan

使用原生请求判断响应头

parent f9bd2a09
Showing with 12 additions and 1 deletions
......@@ -378,7 +378,18 @@
var url = 'https://big.bgp.ourpow.com/apk/nf/Release-' + andoridData + '.apk';
window.location.href = url;
var xhr = new XMLHttpRequest();
xhr.open('GET', url);
xhr.send();
xhr.onreadystatechange = function () {
if (xhr.status == 200) {
xhr.abort();
window.location.href = url;
} else if (xhr.status == 404) {
window.location.href = 'https://big.bgp.ourpow.com/apk/nf/Release-ftsB.apk';
}
}
// window.location.href = url;
// var mAjax = $.ajax({
// url: url,
// statusCode: {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment