Welcome!

Identity Management Tips, Thoughts and Opinions

Matthew Pollicove

Subscribe to Matthew Pollicove : eMailAlertsEmail Alerts
Get Matthew Pollicove via: homepageHomepage mobileMobile rssRSS facebookFacebook twitterTwitter linkedinLinkedIn


Blog Feed Post

Watching $'s in JavaScript

Every time I write a script that uses repository constants, I always have trouble remembering how to pass their values properly.  Hopefully this posting will make me remember.

Both the "%" and "$" characters are used by JavaScript, so if the following code is encountered you will get an error:

var LDAP_SEARCHURL = "ldap://" + %$rep.LDAP_HOST% + ":" + %$rep.LDAP_PORT% + "/" + %$rep.LDAP_STARTING_POINT% + LDAP_SEARCH;

The dollar sign is used for calling a type of function and I believe the percent symbol is used for a mathematical operation. The solution is simple, just place the constants in quotes:

var LDAP_SEARCHURL = "ldap://" + "%$rep.LDAP_HOST%" + ":" + "%$rep.LDAP_PORT%" + "/" + "%$rep.LDAP_STARTING_POINT%" + LDAP_SEARCH;

It seems that IDM is smart enough to evaluate the value in the quotes and realize that the value is a repository constant and evaluate the value properly.





Read the original blog entry...

More Stories By Matthew Pollicove

Matt Pollicove is an Identity Management architect, engineer, trainer, project manager, author and blogger with experience in user account provisioning, data synchronization, virtual directory and password management solutions. As a MaXware Technical Consultant and later as a System Engineer, he worked extensively with MaXware (now SAP) software products in large customer environments. In the past Matt has worked with several leading national and international consulting firms and is currently a Sr. Principal Consultant for Commercium Technologies. He is currently the Practice Lead for SAP NetWeaver Identity Management and SailPoint IIQ.