tags:

views:

42

answers:

1

Is this layer accessible for ajax?

+2  A: 

The ajax code gives you access to the XMLHttpRequest object, which has APIs ("getResponseHeader") to check header elements.

Specifically, the first argument to the "complete" callback is the "xhr" object.

$.ajax({
  // ...
  complete: function(xhr, status) {
    if (xhr.getResponseHeader("X-Hi-Stackoverflow")) {
      // ...
    }
  }
});
Pointy
+1 "complete" callback is the key.
sberry2A