var xmlHttp = new XMLHttpRequest(); xmlHttp.onreadystatechange = function() { if (xmlHttp.readyState == 4 && xmlHttp.status == 200) callback(xmlHttp.responseText); } xmlHttp.open('GET', 'https://api.stockdio.com/data/financial/info/v1/GetIndexInfo?app-key=7BFED955AA2E46B08AA3E67090203164',true); xmlHttp.send(null);