0 Replies Latest reply on Mar 16, 2016 12:21 PM by Brian Winkle

    Question about embedding a dashboard

    Brian Winkle

      I'd like to load the API on-demand in a ReactJS component, so I'm using script.js as such:

       

          $script('https://online.tableau.com/javascripts/api/tableau-2.js', function() {

            const containerDiv = document.getElementById("tableau-container");

            const url = "http://MYURL.online.tableau.com/views/BOOKNAME/DASHBOARD";

            const v = new window.tableau.Viz(containerDiv, url);

          });

       

      It does not seem like the API is actually loaded when the callback function executes. I get this error: `Uncaught TypeError: window.tableau.Viz is not a constructor`

       

      Has anyone managed to successfully do something like this?