11.3.4 namespace
The namespace tag should be used for named elements to ensure that they are associated with the current portlet. Typically you would namespace JavaScript functions, variables. Namespacing uniquely identifies that the element belongs to the portlet and avoids conflicts with other portlets on the page. The namespace tag does not contain a body and it does not have any attributes.
Example 11-8 Using namespace with JavaScript elements
<script language="JavaScript"> var <portlet:namespace/>userName = "Hailey"; function <portlet:namespace />helloUser(){ alert(<portlet:namespace/>userName); } </script> <INPUT type="button" value="Click Me" onclick="<portlet:namespace/>helloUser()"/>
![]()
ibm.com/redbooks