开发者

Detect a 304 redirection on an AJAX request

开发者 https://www.devze.com 2023-03-22 22:45 出处:网络
is there a way to detect whether an AJAX request has been redirected through a 304 response ? I tried an onreadystagechange with xhr.status==304 but got nothing. Are we only bound to 200 response code

is there a way to detect whether an AJAX request has been redirected through a 304 response ? I tried an onreadystagechange with xhr.status==304 but got nothing. Are we only bound to 200 response codes ?

The issue was already raised on SO but I coul开发者_运维技巧dn't find any answer...


if (xhr.status == 304){
    //do your code
}

It should 100% work

0

精彩评论

暂无评论...
验证码 换一张
取 消