JSFiddle - React, Tailwind, and code Playground
by Kishoreajey
HTML
<!-- Visualize: login/logout with SSO sample
-->
<script type='text/javascript' src="https://code.jquery.com/jquery-2.1.0.js"></script>
Enter Server path: <input id="serverPath" style="width:420px;" value="https://spotfire-dev.healthcareit.net/spotfire/wp"/><BR><BR>
Enter Report path: <input id="reportPath" style="width:420px;" value="/Data Products & Services/Dashboards/IHP_BI/CHC Standards/Spotfire CHC Standards"/><BR><BR>
<script type="text/javascript">
var JSLink = $("#serverPath").val();
var JSElement = document.createElement('script');
JSElement.src =JSLink + "/spotfire/wp/render/podL2XvrQWA44MNiLv/GetJavaScriptApi.ashx?Version=7.5";
document.getElementsByTagName('head')[0].appendChild(JSElement);
</script>
<button id="button">View Report</button>
<!--Provide container to render your visualization-->
<br><br>
<div id="container"></div>
JavaScript
// Plain text authentication with report rendering from a list
function createReport(uri) {
v("#container").report({
resource: uri,
scale: "container",
error: function (err) {
alert(err.message);
}
});
};
createReport($("#reportPath").val());
$("#button").click(function () {
$("#container").html("");
createReport($("#reportPath").val());
});
}, function(err){
alert(err.message);
});