1 Reply Latest reply on Oct 15, 2018 4:02 PM by patrick.byrne.0

    RefreshDataAsync is not a function

    sada.ambati

      Hi Team,

       

      I have below metioned html code auto refresh but when i am run this code it showing "ReffreshDataAsync is not function"

       

       

      I am using tableau 10.3  can you please sugesst how to resolve that issue.

       

       

      <html>

      <head><title>Realtime Network Punctuality Dashboard</title></head>

      <body>

      <script type='text/javascript' src="https://serevrname/javascripts/api/viz_v1.js"></script>

      <script src="http://code.jquery.com/jquery-latest.min.js" type="text/javascript"></script>

      <div id="tableauViz">

      </div>

      <script type="text/javascript">

        var viz;

      function initializeViz() {

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

        var url = "https://tableau.servername.com/views/Book2_0/Sheet2?:embed=y&:display_count=yes&:showTabs=y";

        var options = {

          width: "100%",

          height: "100%",

          hideTabs: true,

          hideToolbar: true,

          onFirstInteractive: function () {

            workbook = viz.getWorkbook();

            activeSheet = workbook.getActiveSheet();

          }

        };

        viz = new tableau.Viz(placeholderDiv, url, options);

        }

       

        $(initializeViz);

       

        

        function RefreshViz(){

          //alert("test");

      viz.refreshDataAsync(); 

        }

        

        if (document.addEventListener) {

          window.addEventListener("load", RefreshViz, false);

          } else if (document.attachEvent) {

            window.attachEvent("onload", RefreshViz);

          }

        

          window.setInterval(RefreshViz, 1000);

         

      </script>

       

      </body>

      </html>