Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in BI by (17.6k points)

I'm trying to work through the Tableau .js API tutorial, and immediately I got stuck with a ERR_TOO_MANY_REDIRECTS error when I tried to use the online example with a chart I posted to our server.

I am pretty new to this work, so I thought I'd offer the relevant snippet and see if you can spot anything that's likely to generate re-directs in a loop.

Some notes: "" is just a dummy substitution. It is not a problem.

Here is the code. Thanks for any advice!

<!DOCTYPE html>

<html>

<meta content="text/html;charset=utf-8" http-equiv="Content-Type">

<meta content="utf-8" http-equiv="encoding">

    <head> 

        <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript"></script>

        <script type='text/javascript' src="https://online.tableausoftware.com/javascripts/api/tableau_v8.js"></script>

    </head>        

    <body>

        <script type="text/javascript">

            function initializeViz() {

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

              var url = "http://<PATH TO CHART>";

              var options = {

                width: '1200px',

                height: '600px',

              };

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

            }     

         </script>

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

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

    </body>

 </html>  

1 Answer

0 votes
by (47.2k points)

It's nothing to do with the code. I found that it's a credentialing issue. This issue can be resolved by logging into Tableau in advance so that my credentials were already established for that session. Then when you would reload the above code, it worked. So you have to work out the credential pass-through issues in advance if this code is going to work well for other users.

Related questions

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

Browse Categories

...