3 Replies Latest reply on Jan 12, 2014 10:49 AM by Russell Christopher

    How to embed Tableau JavaScript API?

    paul.p

      I'm a beginner trying to embed Tableau visualization into my web page, such that whenever a link is clicked, the visualization is rendered. But the browser loads with an error on the tableauSoftware object. How can I initialize this object?

      I'm using Tableau server trial version

       

      <html>

      <head>

      <script type='text/javascript' src='http://localhost:85/javascripts/api/viz_v1.js'></script> 

      <script>

              function initializeViz() {

                  var placeholderDiv = document.getElementById("tableauViz");        

                  var url2 = "http://localhost:85/views/test_page/Sheet1?:embed=y&:display_count=no";

                  viz = new tableauSoftware.Viz(placeholderDiv, url2);

              }

      </script>

      </head>

      <body>

      <a href="#" onclick="$('#tableauViz').html(''); initializeViz()">visualize</a>

      <div class id ="tableauViz"></div>

      </body>

      </html>

       

      error.JPG.jpg