Sun Java System Portal Server 7.1 Technical Reference

JavaScript Variables

JavaScript variables are again classified into five categories:

JavaScript URL Variables

URL variables have a URL string on the right hand side. The default ruleset rewrites the following JavaScript URL variables:

The syntax of URL variables in JavaScript content rules is:


<Variable type="URL">variable_name</Variable>

where variable_name is the name of the variable to be rewritten.

JavaScript EXPRESSION Variables

EXPRESSION variables have an expression on the right hand side. The result of this expression is a URL. The Rewriter appends a JavaScript function for converting the expression to the HTML page as it cannot evaluate such expressions. This function takes the expression as a parameter and evaluates it at the client browser.

The default ruleset rewrites the location JavaScript EXPRESSION variable.

The syntax of EXPRESSION variables in JavaScript content rules is:


<Variable type="EXPRESSION">variable_exp</Variable>

where variable_exp is the expression variable.

JavaScript DHTML Variables

DHTML variables are JavaScript variables that hold HTML content. The default ruleset rewrites the following JavaScript DHTML variables:

The syntax of DHTML variables in JavaScript content is:


<Variable type="DHTML">variable</Variable>

where variable is the DHTML variable.

JavaScript DJS (Dynamic JavaScript) Variables

DJS (Dynamic JavaScript) variables are JavaScript variables that hold JavaScript content.

The syntax of DJS variables in JavaScript content is:


<Variable type="DJS">variable</Variable>

where variable is the DJS variable.

The JavaScript code contained in the variable needs another rule to translate it.

JavaScript System Variables

System variables are variables that are not declared by the user, but that are available as a part of the JavaScript standard.

The default ruleset rewrites the window.location.pathname JavaScript system variable.

The syntax of system variables in JavaScript content is:


<Variable type="SYSTEM">variable</Variable>

where variable is the system variable.