How to add an attribute value to info window as a link?

2740
2
Jump to solution
08-22-2014 01:59 AM
HabG_
by
Occasional Contributor

Hi, I am using ArcGIS API for JavaScript and I want to use a value from a feature class attribute as a hyperlink.

For example, "template.setContent("<b>Web Address: <a target='_blank' href=http://www.esri.com>${Web_Address}</a></b>");

This creates an info window with "Web Address" link to ESRI's website.

The web addresses for my features (about 950 features of a polygon features class) are included in the "Link" field. How do I write the code similar to the above example but the link in my info window to point the the attribute record in my "Link" field?

0 Kudos
1 Solution

Accepted Solutions
RiyasDeen
Occasional Contributor III

below should do it.

template.setContent("<a target='_blank' href=${Web_Address}>Link</a>");

View solution in original post

2 Replies
RiyasDeen
Occasional Contributor III

below should do it.

template.setContent("<a target='_blank' href=${Web_Address}>Link</a>");

HabG_
by
Occasional Contributor

Thanks Riyas,

It worked.

0 Kudos