how can I link a CSS stylesheet in a Spotfire analysis?

一曲冷凌霜 提交于 2019-12-11 01:12:36

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!