Ajax: simplify XHR detection.