ERR_TOO_MANY_REDIRECTS:我的代码是否被锁定在一个循环中? [英] ERR_TOO_MANY_REDIRECTS: Is my code locked in a loop?

查看:135
本文介绍了ERR_TOO_MANY_REDIRECTS:我的代码是否被锁定在一个循环中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试完成 Tableau .js API 教程,但当我尝试将在线示例与我发布到我们服务器上的图表一起使用时,我立即陷入了 ERR_TOO_MANY_REDIRECTS 错误.

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 substituion. It is not the 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>  

推荐答案

与代码无关.我发现这是一个凭据问题.我不太了解安全性和登录解析,但也许这会对某人有所帮助:我通过提前登录 Tableau 解决了这个问题,以便我的凭据已经为该会话建立.然后当我重新加载上面的代码时,它起作用了.所以我推断,如果此代码对其他用户运行良好,我必须提前解决凭证传递问题.无论如何,这就是我接下来要尝试的解决方案.HTH

It's nothing to do with the code. I found that it's a credentialing issue. I don't know much about security and log-in resolution, but perhaps this will help someone: I resolved the issue by FIRST logging into Tableau in advance, so that my credentials were already established for that session. Then when I reloaded the above code, it worked. So I infer that I have to work out the credential pass-through issues in advance if this code is going to work well for other users. Anyway, that's the solution path I'm trying next. HTH

这篇关于ERR_TOO_MANY_REDIRECTS:我的代码是否被锁定在一个循环中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆