<html> <head> <title>JavaScript EXPRESSION Variables Test Page</title> </head> <body> <SCRIPT> // Rewriter appends the wrapper function psSRAPRewriter_convert_expression here </SCRIPT> <script LANGUAGE="Javascript"> <!-- //Expression variables var expvar1="images"; var expvar2="/logo.gif"; var expvar =psSRAPRewriter_convert_expression( expvar1 + expvar2);
// Rewriter recognizes the right hand side of this statement to be a JavaScript EXPRESSION variable. Rewriter is not able to resolve the value of this expression at the server end. Hence, the psSRAPRewriter_convert_expression function is prefixed to the expression. The expression is evaluated at the client end, and rewritten as required.
document.write("<A HREF="+expvar+">EXPRESSION</A><P>")
// The rewritten value of expvar from the previous statement is used to arrive at the value of this expression. Because the result is a valid URL (a graphic exists at this location in the sample), the link will work.
var expvar="gateway URL/portal-server-URL/images/logo"+".gif";
// Rewriter recognizes the right hand side of expvar to be a string expression. This can be resolved at the server side, and hence is rewritten directly.
document.write("<A HREF="+expvar+">EXPRESSION</A><P>")
// The rewritten value of expvar from the previous statement is used to arrive at the value of this expression. Because the result is a not a valid URL (a graphic does not exist at the resultant location), the link will not work.
//--> </SCRIPT> Testing JavaScript EXPRESSION variables </body> </html>