10 Days Challenge–Tip #6

Have you worked with ClientGlobalContext yet?

Often times while writing your JS you need to reference the environment. Here’s where ClientGlobalContext.js.aspx comes into play. Reference it from your script using:

<script src="../ClientGlobalContext.js.aspx"></script>

assuming you are using folders to differentiate your resources.

This gives you access to several functions and global variables. The most notable are:

Functions: getOrgUniqueName, getQueryStringParameters, getUserId and getUserRoles

Global Variables: ORG_UNIQUE_NAME, AUTHENTICATION_TYPE, IS_ONLINE

There’s a few others, but I find that these are the ones I use the most.

Enjoy!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

A WordPress.com Website.

Up ↑

%d bloggers like this: