Search code examples
javascripthtmlgisarcgis-js-api

How do I access $NAME variable in a if else statement?


You can find the code in the link below.

Sample running Code

${NAME} in the infoTemplate displays County name.

I want to add a alert box which displays the county name. I can create a alert box but not able to display the county name.

What am I doing wrong?


Solution

  • We can access $NAME outside the infotemplate in the following way... var t = "${NAME}


    Incidents:";+inc // String substitution method var content = esriLang.substitute(evt.graphic.attributes,t);