我想在我的 gsp 页面中添加 javascript 小部件 ( https://www.tradingview.com/widget/market-overview/ )。不确定最新版本的 grails 是否停止使用 . 就我而言,我需要包含以下脚本
<!-- TradingView Widget BEGIN -->
<span id="tradingview-copyright"><a ref="nofollow noopener" target="_blank" href="http://www.tradingview.com" style="color: rgb(173, 174, 176); font-family: "Trebuchet MS", Tahoma, Arial, sans-serif; font-size: 13px;">Market Quotes by <span style="color: #3BB3E4">TradingView</span></a></span>
<script type="text/javascript" src="https://s3.tradingview.com/external-embedding/embed-widget-market-overview.js">
{
"showChart": true,
"locale": "en",
"width": "400",
"height": "400",
"plotLineColorGrowing": "rgba(60, 188, 152, 1)",
"plotLineColorFalling": "rgba(255, 74, 104, 1)",
"gridLineColor": "rgba(233, 233, 234, 1)",
"scaleFontColor": "rgba(218, 221, 224, 1)",
"belowLineFillColorGrowing": "rgba(60, 188, 152, 0.05)",
"belowLineFillColorFalling": "rgba(255, 74, 104, 0.05)",
"symbolActiveColor": "rgba(242, 250, 254, 1)",
"tabs": [
{
"title": "Equities",
"symbols": [
{
"s": "NASDAQ:AAPL",
"d": "Apple"
}
]
}
]
}
</script>
<!-- TradingView Widget END -->
我创建了一个仅包含此内容的新 gsp 页面,但图表未显示。如果我将它粘贴到任何 html 页面(jsfiddle 或 w3schools)中,它就可以工作。在这里需要帮助。