AnsweredAssumed Answered

Add script to popup

Question asked by Kinad on Sep 1, 2016
Latest reply on Sep 4, 2016 by Kinad

I'm wondering if it's possible to add a script tag to a custom popup in ArcGIS Online.  It seems like I can add html tags but script tags just disappear.


As an example.  If I configure a popup for a layer and choose 'custom attribute display', I can view the html source.  If I add the code below, cof_div0 shows up fine but the script never runs to populate cof_div1.

<div id="cof_div0">This is div 0</div>
<div id="cof_div1"></div>
<script>document.getElementById("cof_div1").innerHTML = "Hello World"</script>

If the above is not possible, does anyone know how I can customise popups with javascript.  I need to calculate the date something is going to happen based on a couple of attributes from the layer.