将参数从选择列表传递给json

时间:2018-07-15 18:14:30

标签: javascript jquery json widget

我想从下拉列表中设置窗口小部件的时间间隔,但是将值发送为json格式时遇到问题

    <Select id="list">
       <option value="15m">15 M</option>
       <option selected="selected" value="1h">1 H</option>
       <option value="4h">4 H</option>
       <option value="1D">1 D</option>
    </Select>




 <div class="tradingview-widget-container">
  <div class="tradingview-widget-container__widget"></div>
  <div class="tradingview-widget-copyright"><a href="https://www.tradingview.com/symbols/BITTREX-BCHUSDT/technicals/" rel="noopener" target="_blank"><span class="blue-text">Technical Analysis for BCHUSDT</span></a> by TradingView</div>
  <script type="text/javascript" src="https://s3.tradingview.com/external-embedding/embed-widget-technical-analysis.js" async>

 {
  "width": "500",
  "height": "450",
  "locale": "en",
  "symbol": "BITTREX:BCHUSDT",
  "interval": "1m" <!-- interval -->
}
  </script>
</div>

0 个答案:

没有答案