JSFiddle - React, Tailwind, and code Playground

by Kishoreajey

HTML

<script type='text/javascript' src="https://code.jquery.com/jquery-2.1.0.js"></script>

<script type="text/javascript"> 
var JSLink = $("#serverPath").val();
var JSElement = document.createElement('script');
JSElement.src =JSLink + "/spotfire/wp/GetJavaScriptApi.ashx?Version=7.11";
document.getElementsByTagName('head')[0].appendChild(JSElement);
</script>

Enter Server path: <input id="serverPath" style="width:420px;" value="https://spotfire.healthcareit.net"/><BR><BR>
Enter Report path: <input id="reportPath" style="width:520px;" value="/Data Products & Services/Dashboards/IHP_BI/CHC Standards/Spotfire CHC Standards"/><BR><BR>

<button id="button">View Report</button>

<div id="demoViz" style="display:none;width:1580px;height:742px">Loading...</div>

JavaScript

function createReport(reportPath) {

 var c_serverUrl = JSLink + "/spotfire/wp";
 var c_analysisPath = reportPath;
 var c_parameters = "";  //Optional configuration block
 var customization = new spotfire.webPlayer.Customization();  //Optional configuration settings	
 var app;
 var c_reloadAnalysisInstance = false;

app = new spotfire.webPlayer.Application(c_serverUrl, customization, c_analysisPath, c_parameters, c_reloadAnalysisInstance);
   
		//Hide UI elements
		customization.showDodPanel = true;
		customization.showStatusBar = true;
		customization.showToolBar = true;
		customization.showPageNavigation = true;
		customization.showClose = true;
		customization.showAnalysisInfo = true;
		customization.showExportFile = true;
		customization.showExportVisualization = true;
		customization.showUndoRedo = true;
		customization.showFilterPanel = true;

		var viewOne = app.openDocument("demoViz", "Overview", customization);

}


$("#button").click(function () {
createReport($("#reportPath").val());    
var x = document.getElementById("demoViz");
    //if (x.style.display === "none") {
        x.style.display = "block";
    //}
});