[isAjax]

Description

Link: [isAjax]
Author: Ke Carlton
Category: Utility
Version: 8.x
License: Public Domain
Posted: Oct. 03, 2008
Updated: Oct. 03, 2008
More by this author...

Behold the complexity of this tag - it will intimidate you beyond belief with it's overwhelming internal structure!

Nah, seriously it will simply return true if the current request is an: AJAX, XHR, XMLHTTPRequest request made from the browser...

Parameters

none


Sample Usage

local('content') = 'Hello World';

if:isAjax;
  content_body = #content;
else;
  content_body = '<html><body>'#content'</body></html>';
/if;
						

Source Code

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.
1
2
3
4
5
define_tag:'isAjax',
	-description 	= 'Returns true if call is ajax';
	return(client_headers >> 'XMLHttpRequest');
/define_tag;

 

Comments

none

Email:


Password:



Newest

Most Popular