I have published a Spotfire test dashboard in the Spotfire DEV Library, which is in the database at the company that I work at.

Hi,

I have published a Spotfire test dashboard in the Spotfire DEV Library, which is in the database at the company that I work at. However, I?m having problems accessing it from a web page using JavaScript. Here are a few websites that I looked at which I used to write my JavaScript codes:

http://stn.spotfire.com/stn/Tutorials/WebPlayerOpenFile.aspx

https://www.tibco.com/blog/2014/11/04/integrating-with-javascript-html/

I copied and pasted my JavaScript codes at the end of this message, which I have saved to a Notepad file with a .htm extension. I checked each line of codes carefully with the codes from the above websites, and I don?t seem to be finding the issue. When I load this .htm file in a web browser, the Spotfire session does not appear at all. I have been unable to identify what the issues are with my codes. Please let me know if you find any mistakes in the JavaScript. Any help would be very appreciated. Thank you.

Here are my javascript codes:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 6.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <title>Test Dashboard</title>

  <script type="text/javascript"
          src="http://bsm-bccwdvspf01/SpotfireWeb/GetJavaScriptApi.ashx?Version=6.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( "http://bsm-bccwdvspf01/SpotfireWeb/"
                                               ,customization); 
 
          // Register an error handler to catch errors. 
          app.onError(errorCallback); 
 
          // Register event handler for document opened event. 
          app.onOpened(onOpenedCallback); 
 
          // Register event handler for document closed event. 
          app.onClosed(onDocumentClosedCallback); 
 
          // Open an analysis. 
          app.open( "/Library/Enterprise Platform Services/Platform Engineering/Dan/StoreSales"
                   ,"webPlayer",null); 
      } 
 
      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. 
      } 

      document.write("<br />" + "Text at the end of the page" + "<br />");
  </script> 
 
</head>
<body>
  <div id="webPlayer" style="width: 800px; height: 600px;"></div>
</body>
</html>

 

(1) Answer

Login