Search code examples
javascriptaemsightly

How to pass sightly variable as an argument to java script


This is my code:

<div id="highcharts-sjlyUWsr">
<script src="https://app.everviz.com/inject/sjlyUWsr/" defer="defer" onerror="failed(${sightlyVariable})"></script>
</div>

Notice : I have passed sightly variable in javascript function which is throwing an error message and not working.


Solution

  • Did you try this?

     <script src="https://app.everviz.com/inject/sjlyUWsr/"
     data-sly-test.err="failed('${sightlyVariable}')" defer="defer" onerror="${err@ context='attribute'}" 
    ></script>