Quantcast
Channel: Active questions tagged blazor - Stack Overflow
Viewing all articles
Browse latest Browse all 3962

Passing parameters to anonymous javascript function in Blazor

$
0
0

I am building an app that requires the use of the TradingView advanced chart widget but I want to be able to pass a parameter into the options. This is what the code looks like from the website.

<!-- TradingView Widget BEGIN --><div class="tradingview-widget-container" style="height:100%;width:100%"><div class="tradingview-widget-container__widget" style="height:calc(100% - 32px);width:100%"></div><div class="tradingview-widget-copyright"><a href="https://www.tradingview.com/" rel="noopener nofollow" target="_blank"><span class="blue-text">Track all markets on TradingView</span></a></div><script type="text/javascript" src="https://s3.tradingview.com/external-embedding/embed-widget-advanced-chart.js" async>  {"autosize": true,"symbol": "COINBASE:BTCUSD","interval": "D","timezone": "Etc/UTC","theme": "light","style": "1","locale": "en","enable_publishing": false,"gridColor": "rgba(255, 255, 255, 0.06)","allow_symbol_change": true,"calendar": false,"studies": ["STD;MACD"  ],"support_host": "https://www.tradingview.com"}</script></div><!-- TradingView Widget END -->

I want to be able to pass a parameter for the symbol: for example instead of "COINBASE:BTCUSD" i want it to be "COINBASE:+"@symbol+"" so it can be scalable and for some reason it breaks the code every time, and yes I did pay mind to the "" quotes, its just not passing my blazor variable. What can I do here? Here is the link to the widgets in case it helps: https://www.tradingview.com/widget-docs/widgets/charts/advanced-chart/ Any solution which can make these charts scalable across an entire application would be great


Viewing all articles
Browse latest Browse all 3962

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>