交易视图小部件,它向我显示错误

时间:2019-07-16 18:20:02

标签: javascript tradingview-api

我对交易视图有问题,因为它在控制台日志和可运行的窗口小部件中显示了一些错误,但是错误仍然显示在Consone Log上,我无法解决此问题?

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
    <title>Website Name</title>
  </head>
  <body>
    <script type="text/javascript" src="https://s3.tradingview.com/external-embedding/embed-widget-tickers.js">
                                {
                  "symbols"; [
                    {
                      "title": "EUR/USD",
                      "proName": "FX_IDC:EURUSD"
                    },
                    {
                      "description": "GBP/USD",
                      "proName": "OANDA:GBPUSD"
                    },
                    {
                      "description": "GBP/JPY",
                      "proName": "OANDA:GBPJPY"
                    },
                    {
                      "description": "EUR/GBP",
                      "proName": "OANDA:EURGBP"
                    },
                    {
                      "description": "EUR/JPY",
                      "proName": "OANDA:EURJPY"
                    }
                  ],
                  "colorTheme"; "dark",
                  "isTransparent"; false,
                  "locale"; "en"
                }
                    </script>
    </body>
</html>```

1 个答案:

答案 0 :(得分:0)

由于它是一个库,您应该先调用它,然后再使用它。 试试这个:

<script type="text/javascript" src="https://s3.tradingview.com/external-embedding/embed-widget-tickers.js"></script>
<script>
{
  "symbols"; [
  {
    "title": "EUR/USD",
    "proName": "FX_IDC:EURUSD"
   },
   {
     "description": "GBP/USD",
     "proName": "OANDA:GBPUSD"
   },
   {
     "description": "GBP/JPY",
     "proName": "OANDA:GBPJPY"
   },
   {
     "description": "EUR/GBP",
     "proName": "OANDA:EURGBP"
    },
    {
      "description": "EUR/JPY",
      "proName": "OANDA:EURJPY"
    }
  ],
  "colorTheme"; "dark",
  "isTransparent"; false,
  "locale"; "en"
}
</script>