问题
I can create a Javascript in Spotfire page however I have no idea how to add CSS files.
Any suggestion please?
回答1:
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.
来源:https://stackoverflow.com/questions/48160850/how-can-i-link-a-css-stylesheet-in-a-spotfire-analysis