How to pass a variable from php to javascript if the script is on another server? It is necessary that the value from select is passed to the script, to the "symbol": parameter. It should all be in one php file Code:
echo '
<!-- TradingView Widget BEGIN -->
<div class="tradingview-widget-container">
<div class="tradingview-widget-container__widget"></div>
<script type="text/javascript" src="https://s3.tradingview.com/external-embedding/embed-widget-technical-analysis.js" async>
var pair = "FX:GBPUSD";
{
"interval": "1m",
"width": 425,
"isTransparent": false,
"height": 450,
"symbol": pair,
"showIntervalTabs": true,
"locale": "ru",
"colorTheme": "light",
"largeChartUrl": "https://example.com"
}
</script>
</div>
<!-- TradingView Widget END -->
';
?>
I tried various options, but nothing works until explicitly specified in the script, for example: "symbol":"FX:GBPUSD"