Subscribe to Product Updates

Using the Dashboard HTML Panel Widget

Follow

Comments

4 comments

  • Avatar
    Spiros Swanson

    Why don't you allow script tags in the HTML panel? It would be nice to put some custom js on the panel for more versatility.

    0
    Comment actions Permalink
  • Avatar
    Mike

    Spiros,

    Apologies for the late reply. Allowing script tags was determined to be a security issue. We are looking into possible solutions to allow them in the future.

    Mike

    0
    Comment actions Permalink
  • Avatar
    Spiros Swanson

    Hi Mike,

    Thanks for the reply!

    I got around the lack of script tags with the following method. Any notes would be appreciated.

    <div id="loadapp"><button onclick="
        /* Add js sources here */
        let scriptSrcs = ['https://ajax.aspnetcdn.com/ajax/jQuery/jquery-3.6.0.min.js'], script;
        
        /* Load all of js sources above to the page */
        for(src of scriptSrcs){
          script = document.createElement('script');
          script.setAttribute('type', 'text/javascript');
          script.setAttribute('src', src);
          document.head.appendChild(script);
        }
        document.getElementById('loadapp').style.visibility = 'hidden';
    
        document.getElementById('panelapp').style.visibility = 'visible';
    
      ">Load App</button></div>
    <div id="panelapp" style="visibility: hidden;">
    <!--
      Add single page application code here
    -->
    </div>
    0
    Comment actions Permalink
  • Avatar
    Mike

    Very clever, Spiros! We're going to do some testing on this method and will let you know if there are any potential issues.

    0
    Comment actions Permalink

Please sign in to leave a comment.