我是一名嘗試將Tableau可視化內容嵌入到我的網頁中的初學者,因此無論何時單擊鏈接,都會在頁面上呈現可視化效果。但瀏覽器會在tableauSoftware對象上加載一個錯誤。我怎樣才能初始化這個對象?如何使用Tableau JavaScript API將Tableau嵌入到網頁中?
我使用的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>
我得到這個錯誤:
很好的問題! –