我正在阅读customization.html#loading-custom-scripts-and-stylesheets,它要求我做以下工作,我已经这样做了:
oc edit configmap/webconsole-config -n openshift-web-console
// I put in the below (obviously with a correct URL):
scriptURLs:
- https://url-for-a-js-file
// And also tried it with the below:
scriptURLs:['https://url-for-a-js-file']上面的JS文件如下所示:
(function() {
console.log('---testing a script!---');
}());然而,这两种方法都不起作用。控制台从不显示已记录的语句。
我知道文档上写着“脚本和样式表必须与正确的内容类型一起使用,否则浏览器不会运行它们。脚本必须与内容- type : application/javascript和带有内容的样式表-Type:text/css一起使用。”但如果我只是从HTTPS服务器(在本例中是gitlab URL)链接它,我不确定如何‘为’提供这样的文件。
发布于 2018-11-15 20:29:12
它看起来像是指向脚本的外部github或gitlab URL。您必须将该文件托管在其他地方。
https://stackoverflow.com/questions/53302519
复制相似问题