Skip to main content
RSS feed Subscribe to feed


Web Player: Open File

This example shows how to add a reference to the JavaScript API, and how to load an analysis. An open parameter block is used to set a parameter in the information link and to run a bookmark.

The procedure can be used to load an analyses containing information links, but to configure the parameters at runtime, for instance by retrieving them from a web portal.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
<html xmlns="">
    <title>API Scenario</title>

    <script type="text/javascript" src="../GetJavaScriptApi.ashx?Version=1.0"></script>

    <script type="text/javascript">
        window.onload = function()
            var customization = new spotfire.webPlayer.Customization();
            customization.showTopHeader = false;
            customization.showToolBar = false;

            var app = new spotfire.webPlayer.Application("../SpotfireWeb/", customization);
            // Register an error handler to catch errors.
            // Register event handler for document opened event.
            // Register event handler for document closed event.
            // Open an analysis.
                "TIBCO Spotfire Example Files/StoreSales/StoreSales", 
                'Parameter.BusinessLocation = {Boston, Seattle}; ApplyBookmark(bookmarkName = "All");');
        function errorCallback(errorCode, description) {
            // Displays an error message if something goes wrong in the Web Player.
            alert(errorCode + ": " + description);

        function onOpenedCallback(analysisDocument)
            // Document is now opened and ready for interactions.
        function onDocumentClosedCallback(analysisPath)
            // Document is now closed.

    <div id="webPlayer" style="width: 800px; height: 600px;"></div>