I wonder if it is possible to incorporate a url/hyperlink into the JS command for a pop-up box in Mapbox. Here is the code :
.setHTML(
'<h3>'+
currentFeature.properties.Name+'</h3>' +
'<h4>' +
currentFeature.properties.Height+'</h4>' +
'<a href="currentFeature.properties.Link">'further details+'</a>'
Where Name, Height and Link come from a Geojson file saved as .js file and these are field names, the dataset is of some 200 records.Link would refer to the url as text, but I'm not sure if this would be displayed as a hyperlink in a popup box. The error message I am getting is 'missing )after argument list, which refers to the last line of the code above.
Yes, it works fine. But your code is making the link the literal text "currentFeature.properties.Link". You should change it to:
.setHTML(
'<h3>'+
currentFeature.properties.Name+'</h3>' +
'<h4>' +
currentFeature.properties.Height+'</h4>' +
'<a href="' + currentFeature.properties.Link + '">further details</a>'