So I've been able to successfully embed a workbook hosted on Tableau Server using the html embed code. I now want some more flexibility with which reports I'm displaying to certain users of the website so I'm moving to the Javascript API. Unfortunately the workbook now isn't loading.
I'm following the Basic Embed tutorial on Tableau's website: https://onlinehelp.tableau.com/current/api/js_api/en-us/JavaScriptAPI/js_api_sample_basic_embed.html
Here's my code:
function initViz() {
var placeholderDiv = document.getElementById('tableauPlaceholder');
var url = 'https://#########.#######.###/views/EnrollmentTool/EnrollmentChange'
var options = {
hideTabs: true,
onFirstInteractive: function () {
console.log("Run this code when the viz has finished loading.");
}
};
var viz = new tableau.Viz(placeholderDiv, url, options);
}
The onFirstInteractive log statement doesn't get called, so it seems that the viz isn't actually loading.