How To: Add hyperlinks to the footer of a pop-up window using ArcGIS API for JavaScript


Adding a hyperlink to an InfoWindow footer (next to the Zoom to hyperlink) can be achieved by using the domConstruct.create function. The effect is as shown in the example below:

Photo example of hyperlink in footer of an InfoWindow


The following script demonstrates how to add hyperlinks to the footer of an infoWindow.

var link = domConstruct.create("a",{ 
 "class": "action", 
 "id": "statsLink", 
 "innerHTML": "More Information", //the text representing the link
 "href": "javascript: void(0);" 
 }, query(".actionList",map.infoWindow.domNode)[0]); 
 on(link, "click", [function name]); 

function cp(evt){ 
 window.open("http://url"); //set the url to be displayed
The code snippet can also be used to activate geoprocessing tools. For more information, refer to the following web help document: ArcGIS API for JavaScript: Geoprocessing tool link in popup
The code only works for ArcGIS API for JavaScript 3.x.

Related Information