LassoScript Utility
Basics Browse Detail

[LJAX_Target] ... [/LJAX_Target]

Tag Link [LJAX_Target] ... Category LJAX
Type Container Source Available Yes
Support Preferred Version 8.5
Change New Data Source Any
Output Type None Security None
Implementation Sets Lasso 8.5

Description

[LJAX_Target] ... [/LJAX_Target] surrounds portions of a page in order to control whether they are returned when different LJAX targets are called. This tag should only be used when a page is part of an LJAX-enabled solution. More information about how to use LJAX on a site can be found in the Lasso Language Guide.

Lasso pages can accept a -Target action parameter which specifies an LJAX target that should be returned for the page. Lasso pages are normally called with no target. When a site is LJAX-enabled pages will initially be called with no target, then later be called with a specific target in order to dynamically update portions of a page.

The [LJAX_Target] tag accepts a -Target parameter which specifies what LJAX target (specified as a string) or list of targets (specified as an array of strings) the contents of the tag should be returned for. If specified with an -AnyTarget parameter then the contents of the page will be returned when any LJAX target is called.

If specified with a -NoTarget parameter then the contents of the tag will be returned when no LJAX target is called. If both -NoTarget and -Target are specified then the contents will be returned when either no target or the specific LJAX target or targets are called.

[LJAX_Target] ... [/LJAX_Target] tags can be nested, but inner tags will only be called if the outer tags match a superset of the list of targets as the inner tag or if both specify -NoTarget.

The contents of this container should always be valid XHTML code and the complete page returned for any LJAX target should always be a valid XHTML fragment. The code returned for -NoTarget does not need to validate as XHTML.

If a -NoOutput parameter is specified for the opening tag then the contents of the container is processed normally, but no result is returned. This can be useful when code needs to be processed when certain targets are specified, but the output of that code should not be transmitted to the client.

The example code shows an HTML page which includes [LJAX_Target: -NoTarget] ... [/LJAX_Target] around the HTML code that makes up the shell of the page. The contents of the page is included in a

surrounded by [LJAX_Target: -Target='content', -NoTarget] ... [/LJAX_Target] in order to return that content both on the initial page load and when attempting to dynamically reload the contents of the page.

Syntax

[LJAX_Target: -NoTarget]

LJAX Page

[/LJAX_Target]
[LJAX_Target: -NoTarget, -Target='content']

This is the contents of the page

[/LJAX_Target]
[LJAX_Target: -NoTarget]


[/LJAX_Target]

Parameters

Optional Parameters
-NoTarget If specified then the contents will be processed when the page is called with no LJAX target.
-AnyTarget If specified then the contents will be processed when the page is called with any LJAX target.
-Target Accepts either a string or an array of strings. If specified then the contents will be processed if the specified target or targets is called.

Examples

See the Lasso 8 Language Guide for examples of how to use this tag.

Related Tags