I am pulling out data from a external source and the data seems to appear in a different order after every page refresh. I'm unsure if its related to my jquery or a lack of. Or if it's related to the google finance data I use to collect the data. Ideally I would like it sorted by column one alphabetically.
I'm adamant that there has to be a way to sort the array without it populating the list randomly. JSfiddle:
https://jsfiddle.net/vkf0jhpq/
$(document).ready(function () {
for (var i = 0; i < gstock.length; i++) {
$.getJSON("https://finance.google.com/finance/info?client=ig&q=" + gstock[i] + "&callback=?", function (response) {
var stockInfo1 = response[0];
var divContainer = $('*[data-symbol="' + stockInfo1.t + '"]');
var percentStock = !isNaN(stockInfo1.c) && !isNaN(stockInfo1.l) && stockInfo1.l ? ((parseFloat(stockInfo1.c)/parseFloat(stockInfo1.l)) * 100) : undefined;