Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/466.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何使用Tableau JavaScript API将Tableau嵌入网页?_Javascript_Tableau Api - Fatal编程技术网

如何使用Tableau JavaScript API将Tableau嵌入网页?

如何使用Tableau JavaScript API将Tableau嵌入网页?,javascript,tableau-api,Javascript,Tableau Api,我是一个初学者,尝试将Tableau可视化嵌入到我的网页中,这样每当单击链接时,可视化就会呈现在网页上。但是浏览器在加载tableauSoftware对象时出错。如何初始化此对象 我使用的是Tableau服务器试用版 <html> <head> <script type='text/javascript' src='http://localhost:85/javascripts/api/viz_v1.js'></script>

我是一个初学者,尝试将Tableau可视化嵌入到我的网页中,这样每当单击链接时,可视化就会呈现在网页上。但是浏览器在加载tableauSoftware对象时出错。如何初始化此对象

我使用的是Tableau服务器试用版

<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>

函数initializeViz(){
var placeholder div=document.getElementById(“tableauViz”);
变量url2=”http://localhost:85/views/test_page/Sheet1?:embed=y&:display_count=no";
viz=新的餐具软件。viz(占位符div,url2);
}
我得到这个错误:


我手头没有笔记本电脑,无法确认本地Tableau服务器安装应使用哪个脚本,但请尝试Tableau公共脚本(按照),看看是否有任何更改:

<script type="text/javascript" src="http://public.tableausoftware.com/javascripts/api/tableau_v8.js"></script>  

现在检查了我自己的本地Tableau服务器安装,您需要的脚本如下:

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