Skip to content

Instantly share code, notes, and snippets.

@andre347
Created October 12, 2018 14:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andre347/4605eb9f887329052316162f8c8c7b79 to your computer and use it in GitHub Desktop.
Save andre347/4605eb9f887329052316162f8c8c7b79 to your computer and use it in GitHub Desktop.
Tableau Extension: Step 3
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Data-Refresh Tableau</title>
</head>
<body>
<h1>Hello Tableau!</h1>
<script src="js/tableau-extensions-1.latest.min.js"></script>
<script src="js/app.js"></script>
</body>
</html>
// When the DOM has load, run the function load
document.addEventListener("DOMContentLoaded", load);
function load() {
//initialise the tableau object, wait for the promise to return and grab the name of the dashboard
tableau.extensions.initializeAsync().then(() => {
const dashboard = tableau.extensions.dashboardContent.dashboard;
console.log(dashboard.name);
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment