Hi Robert, thanks for the reply. I've uploaded a very stripped down and simplified version I was testing on to try to isolate the problem. Everything is in one file, no css or really that much Js going on in this version.
I've noticed if I use one of the fields that I know has no spaces in it (ThumbnailUrl for example) it works perfectly, but if I set it up to log transaction _type (or any other attribute with a space in it) I get that error.
To get the error just open a popup and select view details.
Thanks!
---------------------------------------------------------------------------------------------------------------------------------------------------------------
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no" />
<title>ERROR TESTING</title>
<style>
html,
body,
#viewDiv {
padding: 0;
margin: 0;
height: 100%;
width: 100%;
}
</style>
<link rel="stylesheet" href="https://js.arcgis.com/4.11/esri/themes/light/main.css" />
<script src="https://js.arcgis.com/4.11/"></script>
<script>
require(["esri/Map", "esri/views/MapView", 'esri/layers/FeatureLayer', 'esri/PopupTemplate'], function(Map, MapView, FeatureLayer, PopupTemplate) {
pointLayerUrl = 'https://utility.arcgis.com/usrsvcs/servers/1ef8d2605f5544b79bc34b7b363a7979/rest/services/Development/DEVRealEstateListing/MapServer/0'
var popupImage = "<div class ='popupImageContainer'><a href ={ThumbnailURL} target='_blank'><img src={ThumbnailURL} onerror=this.src='rescources/internal/img/NoImage.png' class='popupImage'></a></div>";
var popupText = "<div class ='popupText'>List Price: ${List_Price}<br>Sale Type: {Transaction_Type}<br></div>";
var popupViewDetailsButton = "<button class='button popupButton' id='viewDetailsPopupButton' onclick=console.log('{Transaction_Type}')>ViewDetails</button>";
var popupContent = popupImage + popupText + popupViewDetailsButton;
var template = {
title: "{FullAddress}",
content: popupContent
};
var pointLayer = new FeatureLayer({
url: pointLayerUrl,
definitionExpression: "1=1",
outFields: ['ThumbnailURL', 'List_Price', 'Transaction_Type',],
popupTemplate: template
});
var map = new Map({
basemap: 'topo',
layers: [pointLayer]
});
var view = new MapView({
container: "viewDiv",
map: map,
zoom: 10,
center: [-80.599567, 44.399800],
});
});
</script>
</head>
<body>
<div id="viewDiv"></div>
</body></html>