It works if your JavaScript library sets an X-Requested-With HTTP header.
It is known to work with common JavaScript frameworks:
public static isXmlHttpRequest ( ) : boolean | ||
return | boolean | true if the request is an XMLHttpRequest, false otherwise |