4

I can create a Javascript in Spotfire page however I have no idea how to add CSS files.

Any suggestion please?

niko
  • 3,946
  • 12
  • 26
beewest
  • 4,486
  • 7
  • 36
  • 63

1 Answers1

4

this is not approved by Spotfire engineering, but you can inject a CSS that is hosted somewhere accessible to the machine running Spotfire (so, your local machine or a web player node) with JQuery:

$('head').append('<link rel="stylesheet" href="path/to/stylesheet.css" type="text/css" />');

so just put that into a JS inside a Text Area and voila!

one thing to note is that the file will be cached, you may want to update the code like:

var t = Date.now();
$('head').append('<link rel="stylesheet" href="style2.css?t=' + t + '" type="text/css" />');

this will append the current timestamp to the URL of the stylesheet ensuring you get a fresh copy every time. it's advised to do this only until you're done modifying the CSS.

niko
  • 3,946
  • 12
  • 26