What is the correct syntax needed here for my variable text?
$.getJSON('https://www.alphavantage.co/query?
function=BATCH_STOCK_QUOTES&symbols=MSFT&apikey=TRZC92S2OMSWBC8H',
function(data) {
var text = `Date: ${data.{"Stock Quotes"}.[{"1. symbol"}]}<br>
Time: ${data.{"Stock Quotes"}.[{"2. price"}]}<br>`
$(".mypanel").html(text);
});
The JSON looks like this in raw form:
{
"Meta Data": {
"1. Information": "Batch Stock Market Quotes",
"2. Notes": "IEX Real-Time Price provided for free by IEX (https://iextrading.com/developer/).",
"3. Time Zone": "US/Eastern"
},
"Stock Quotes": [
{
"1. symbol": "MSFT",
"2. price": "100.0600",
"3. volume": "18924367",
"4. timestamp": "2018-07-02 16:45:04"
}
]
}
This question is different from the other question in that it uses the getJSON function.