0 Replies Latest reply on Oct 2, 2013 8:06 AM by botao zheng

    Tableau Javascript API, load workbook

    botao zheng

      I am new user of Tableau Javascript API.


      I installed the tableau server free trial version on my home computer, The following code in the same computer works,  but when I use the same code in another computer, it doesn't load anything,  what is my problem?  Besides, I can see my dashboard from the Tableau server in other computer by http://Shirley-PC.bte.net:8000.  Even though I replace the




      still now work!


      Thanks in advance!



      <!DOCTYPE html>


      <html lang="en" xmlns="http://www.w3.org/1999/xhtml">
          <meta charset="utf-8" />
      <body onload ="initializeViz()" >
      <script type="text/javascript" src="http://localhost:8000/javascripts/api/viz_v1.js"></script>   
      <object class="tableauViz" width="800" height="600"  style="display:none;">
        <param name="site_root" value="" />
        <param name="name" value="try&#47;try"" />
        <param name="tabs" value="yes"/>
        <param name="toolbar" value="yes" />


      <script type="text/javascript">
          function initializeViz() {
              var placeholderDiv = document.getElementById("tableauViz");
              var url = "http://public.tableausoftware.com/views/WorldIndicators/GDPpercapita";
              alert("Hello! I am an alert box!!");


              var options = {        


                  width: placeholderDiv.offsetWidth,
                  height: placeholderDiv.offsetHeight,
                  hideTabs: true,
                  hideToolbar: true,       
                  onFirstInteractive: function () {
                      workbook = viz.getWorkbook();
                      activeSheet = workbook.getActiveSheet();
              viz = new tableauSoftware.Viz(placeholderDiv, url, options);