Read the statement by Michael Teeuw here.
Assistance with JavaScript widget
-
Hi,
I’m a complete noob to coding but new to the MagicMirror.
I have a few modules already loaded and working eg. MMM-cryptocurrency and MMM-Widget. The latter is displaying Tradingview widgets without any issues.My problem is:
I want to add another widget but it doesn’t display on the mirror. All i see is a white space where the widget is supposed to be.
The module MMM-Widget is installed and this is the entry on in the config file.
{
module: “MMM-Widget”,
config: {
widgets: [
//This widget works
{
html:<!-- TradingView Widget BEGIN --> <div class="tradingview-widget-container"> <div class="tradingview-widget-container__widget"></div> <div class="tradingview-widget-copyright"><a href="https://www.tradingview.com" rel="noopener" target="_blank"><span class="blue-text">Quotes</span></a> by TradingView</div> <script type="text/javascript" src="https://s3.tradingview.com/external-embedding/embed-widget-tickers.js" async> { "symbols": [ { "description": "DOGECOIN", "proName": "BITTREX:DOGEUSD" }, { "description": "GOLD", "proName": "OANDA:XAUUSD" }, { "description": "AUD/USD", "proName": "OANDA:AUDUSD" }, { "description": "EUR/USD", "proName": "OANDA:EURUSD" }, { "description": "GBP/USD", "proName": "OANDA:GBPUSD" }, { "description": "AUD/CAD", "proName": "OANDA:AUDCAD" }, { "description": "EUR/CAD", "proName": "OANDA:EURCAD" }, { "description": "EUR/AUD", "proName": "OANDA:EURAUD" } ], "colorTheme": "dark", "isTransparent": true, "showSymbolLogo": true, "locale": "en" } </script> </div> <!-- TradingView Widget END -->
, //insert your script or html codes here.
position: “bottom_center”,
width: “1800px”,
height: “105px”,
backgroundColor: “0000”
},
//This is the widget that doesn’t display
{
html:<script type="text/javascript"> DukascopyApplet = {"type":"fxmarkethours", "params":{ "showHeader":true, "displayMainMenu":false, "displayTimezoneChange":true, "displayInstrumentChange":true, "displayFollowButton":true, "allowTimezoneChange":true, "allowInstrumentChange":true, "defaultTimezone":1, "showIndicator":"0", "defaultFollowMode":true, "worldMapColor":"blue", "hoursBackground":"#444f5f", "hoursActiveBackground":"#7d92b0", "hoursTextColor":"#ffffff", "currentHourBGColor":"#f9fdff", "dstHourColor":"#0cf6ff", "indicatorBarColor":"#5090c6", "graphPointsColor":"#ffffff", "width":"743", "height":"433", "adv":"popup", "lang":"en" } }; </script>
,
position: “right”,
width: “800px”,
height: “450px”,
backgroundColor: “#ffff”
}
]
}
},Please help if you are able to.
Thank you!
Jason -
@jasond the second on is not a widget, it is code… < script…< /script>
MM is expecting html content