Difference between revisions of "Global JavaScript Variables"
From AgileApps Support Wiki
imported>Aeric m (Text replace - '[[Role Based Access' to '[[Data Access') |
imported>Aeric |
||
Line 8: | Line 8: | ||
:;LJUserName:Name of the (logged in) User | :;LJUserName:Name of the (logged in) User | ||
:;LJPrimaryTeamName:Name of the [[Primary Team]] (user is a member of this team) | :;LJPrimaryTeamName:Name of the [[Primary Team]] (user is a member of this team) | ||
:;LJPrimaryTeamRoleName:[[ | :;LJPrimaryTeamRoleName:User's [[Role]] | ||
====Page Variables==== | ====Page Variables==== |
Revision as of 19:00, 28 June 2013
The following JavaScript variables are global. They are available in all JavaScript code running on the platform.
- Considerations
-
- Variable names are case-sensitive
- In a Site, no one is logged in, and the page is not running on the platform, so the variables have no meaning in that context.
User Variables
- LJUserName
- Name of the (logged in) User
- LJPrimaryTeamName
- Name of the Primary Team (user is a member of this team)
- LJPrimaryTeamRoleName
- User's Role
Page Variables
- lj_window_src
- Contains the URL of the current page. (Needs to be URL encoded when used.)
- Sample Usage
- <syntaxhighlight lang="javascript" enclose="div">
encodeURIComponent(lj_window_src) </syntaxhighlight>