如何在Spotfire分析中链接CSS样式表? [英] how can I link a CSS stylesheet in a Spotfire analysis?
问题描述
我可以在Spotfire页面中创建Javascript,但是我不知道如何添加CSS文件.
I can create a Javascript in Spotfire page however I have no idea how to add CSS files.
有什么建议吗?
推荐答案
这未获得Spotfire工程部门的批准,但是您可以注入托管在运行Spotfire的计算机(因此,您的本地计算机或网络)可以访问的位置的CSS播放器节点)与JQuery:
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" />');
所以只需将其放入文本区域内的JS中,瞧!
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" />');
这会将当前时间戳附加到样式表的URL,以确保您每次都获得新的副本.建议仅在修改完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.
这篇关于如何在Spotfire分析中链接CSS样式表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!