Link | lp_client_isAJAX |
Author | Bil Corry |
Category | Client |
Version | 8.5.x |
License | Public Domain |
Posted | 03 Dec 2007 |
Updated | 03 Dec 2007 |
More by this author... |
This tag will return true when the header "X-Requested-With: XMLHttpRequest" is found. The header is added by jQuery, Prototype and possibly other JavaScript libraries. Note that this header is easily spoofed.
lp_client_isAJAX; // that's it!
Click the "Download" button below to retrieve a copy of this tag, including the complete documentation and sample usage shown on this page. Place the downloaded ".inc" file in your LassoStartup folder, restart Lasso, and you can begin using this tag immediately.
[ define_tag: 'lp_client_isAJAX', -description='Returns true if client is an AJAX (XHR) request.', -priority='replace'; // looks for header "X-Requested-With: XMLHttpRequest" added by jQuery and Prototype (and others?) // note, can be easily spoofed! if: (string_findregexp: client_headers, -find='X-Requested-With:\\s+XMLHttpRequest', -ignorecase)->size; return: true; /if; return: false; /define_tag; ]
No comments
©LassoSoft Inc 2015 | Web Development by Treefrog Inc | Privacy | Legal terms and Shipping | Contact LassoSoft