Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
/*
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