, , , . , javascript , , , , - DOM , .
JQuery DOM , ready (function() {...}).
, sortThis():
$(document).ready( function() {
sortThis();
});
, DOM , sortThis().
, $.get() , , DOM , , , , . $.get() " ", sortThis() , , . : async = false , , , GET .
$.get('myfile.csv', async=false, function(data) {
myfile = jQuery.csv()(data)
for (var x = 0; x ";
for (var y = 0; y " + myfile[x][y] + "";
}
str += "";
$('#myTable').append(str);
}
});
sortThis();
the best solution, in my opinion, is to call your call to sortThis () inside the callback function. This will cause the page to take less time to load and process, since the rest of your script may continue while data is being exchanged with the server. I would use the following solution:
$.get('myfile.csv', function(data) {
myfile = jQuery.csv()(data)
for (var x = 0; x ";
for (var y = 0; y " + myfile[x][y] + "";
}
str += "";
$('#myTable').append(str);
}
sortThis();
});
Hope this helps;) let me know what results you get ...