2

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 couldn't find any answer...

Cystack
  • 3,301
  • 5
  • 35
  • 33

1 Answers1

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

It should 100% work

genesis
  • 50,477
  • 20
  • 96
  • 125
  • in the onreadystatechange method, right ? As stated, it is not working for me though... I get an "INVALID_STATE_ERR" instead :/ – Cystack Jul 27 '11 at 01:08
  • In my test I get only 200, even if I see that the browser is caching – rekire Aug 01 '17 at 10:38