Select to view content in your preferred language

HTML issue in Hub

697
2
05-24-2022 03:29 PM
ErichSchreier
Occasional Contributor

Hello,

I am working on a hub site and am trying to embed a WalkScore widget, for which the code is provided by WalkScore. When I copy and paste the code in the HTML editor, the text box remains blanc and then when I return to the editor, the code has been significantly reduced.

I removed the urls and location info for privacy, but here is the code: 

<script type='text/javascript'>
var ws_wsid = '';
var ws_address = ';
var ws_format = 'tall';
var ws_width = '400';
var ws_height = '500';
</script><style type='text/css'>#ws-walkscore-tile{position:relative;text-align:left}#ws-walkscore-tile *{float:none;}</style><div id='ws-walkscore-tile'></div><script type='text/javascript' src=''></script>

Is there something in the code that could be changed so this widget can be displayed, or is there something here that is not supported in hub? 

Thank you!

Tags (2)
0 Kudos
2 Replies
NFlourish
Frequent Contributor

Hi @ErichSchreier - sadly, last I checked, you cannot embed <SCRIPT> tags (and thusly JavaScript) into a Hub site. I think it is actually more generally just not available in AGOL at all. Esri has noted in the past that they have safety and stability concerns around allowing embedded JavaScript on their sites. I'm not sure if this is exhaustive for Hub specifically, but it is a good place to start:

https://doc.arcgis.com/en/arcgis-online/reference/supported-html.htm

If you need a custom widget of some sort on your site the only real option is to host it elsewhere as a separate web page, and embed that page / URL into your Hub site with an iFrame.

0 Kudos
KlaraSchmitt
Esri Regular Contributor

NFlourish is correct. Hub does not allow custom javascript or javascript packages due to security concerns.

0 Kudos