TradingView图表小部件损坏了我的页面速度。我需要加载javascript异步/延迟。但是,将其添加到脚本中会使它消失。
我将其用于以下瑞典页面上的图表:https://cryptorunner.com/sv/hur-man-koper-bitcoin/
在wordpress编辑器中使用以下特定代码:
<div class="tradingview-widget-container"><script type="text/javascript" src="https://s3.tradingview.com/tv.js"></script>
<script type="text/javascript">
new TradingView.widget(
{
"autosize": true,
"symbol": "BITFINEX:BTCUSD",
"interval": "D",
"timezone": "Etc/UTC",
"theme": "Light",
"style": "3",
"locale": "sv_SE",
"toolbar_bg": "#f1f3f6",
"enable_publishing": false,
"hide_top_toolbar": true,
"hide_legend": true,
"allow_symbol_change": true,
"container_id": "tradingview_7589b"
}
);
</script></div>
您将在此处找到代码:
https://uk.tradingview.com/HTML5-stock-forex-bitcoin-charting-library/
如果有人可以帮助我懒加载此图表,我将不胜感激。任何想法为什么不起作用?