I'm a beginner in JavaScript. I'm trying to embed some code from external website. The embedded code works fine in my webpage . However, a JSON object that is defined in the script tag causes problems of semicolon expectations in the VS Code.Program works properly even with errors. What should I do to get rid of these errors ?
MY CODE :
<!-- 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-forex-cross-rates.js" async>
{
"width": "800",
"height": "500",
"currencies": [
"EUR",
"USD",
"JPY",
"GBP",
"CHF",
"AUD",
"CAD",
"NZD",
"CNY",
"TRY",
"SEK",
"NOK",
"DKK",
"ZAR",
"HKD",
"SGD",
"THB",
"MXN",
"IDR",
"KRW",
"PLN",
"ISK",
"KWD",
"PHP",
"MYR",
"INR",
"TWD",
"SAR",
"AED",
"RUB",
"ILS",
"ARS",
"CLP",
"COP",
"PEN",
"UYU"
],
"isTransparent": false,
"colorTheme": "light",
"locale": "en"
}
</script>
</div>
<!-- TradingView Widget END -->
Semicolon are expecting instead of colons such as "width":"800". Colons(:) are underlined with red color.
When I tried to declare that object with a name such as var a = {}, errors are disappearing however embedded code is not working.