Skip to content

Instantly share code, notes, and snippets.

@beckettkev
Last active April 6, 2016 12:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save beckettkev/cd45d335d54e54ca44851f867b9934d5 to your computer and use it in GitHub Desktop.
Save beckettkev/cd45d335d54e54ca44851f867b9934d5 to your computer and use it in GitHub Desktop.
/*
The following code assumes you have a javascript namespace called MyCompany. I recommend you either swap that out for your namespace or create an instance of MyCompany before trying the code
var MyCompany = MyCompany || {};
*/
(function (userProfiles, $) {
//This is where we hold our lovely properties
userProfiles.Current = {
Account: '',
FullName: '',
OfficeLocation: '',
Region: '',
Country: '',
Global: '',
Campaign: '',
Group: '',
Business: ''
};
//...
})(MyCompany.UserProfiles = MyCompany.UserProfiles || {}, jQuery);
//now we can get at our properties (when populated) using MyCompany.UserProfiles.Current.<PROPERTY NAME>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment