HOW TO

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

Last Published: September 11, 2023

Summary

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

Procedure

The following script demonstrates how to add hyperlinks to the footer of an infoWindow.
Code:
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
 }
Note:
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
Note:
The code only works for ArcGIS API for JavaScript 3.x.

Article ID: 000014528

Software:
  • ArcGIS API for JavaScript 3 x

Receive notifications and find solutions for new or common issues

Get summarized answers and video solutions from our new AI chatbot.

Download the Esri Support App

Related Information

Discover more on this topic

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options