I have this HTML snippet that is called on some screens when needed (clicking it opens an iframe inside the HTML):
<a href="#" class="tour-360" id="tour-360-{{unit.hash}}" data-toggle="modal" data-target="#modal-tour-360">
<h3 class="title-360">
360º Tour {{ unit.title }}
<small>Visualize sua unidade</small>
</h3>
</a>
Depending on {{unit.hash}}, instead of being href="#" and opening this iframe, I need to take the user to an external URL, open another link on a link. It would be something like this (just a non-functional example to explain):
<script type="text/javascript">
var url360 = '#';
if('{{unit.hash}}' == 's-j-dos-campos'){
url360 = 'https://www.aurlqueeuquiser.com';
}
</script>
<a href="<script type="text/javascript"> alert(url360); </script>" class="tour-360" id="tour-360-{{unit.hash}}" data-toggle="modal" data-target="#modal-tour-360">
<h3 class="title-360">
360º Tour {{ unit.title }}
<small>Visualize sua unidade</small>
</h3>
</a>
How to do it? I need all the changes to be made within that HTML, I can not put any external files or anything like this.