I am currently using this code to bring data into a <div>
, it works however it's not a good user experience. I have to wait for this external file to be populated with data and then when it's finished then it pulls in the file. This sometimes can cause a 5 second delay. Meanwhile the user is starting at a white screen with a spinner.
<script>
$(function () {
$(".viewdata").click(function() {
var cuser = document.genericform.guserid.value;
var dataString = '&cuser='+ cuser;
var findDiv ="allproductsdiv";
$.ajax({
type: "POST",
url: "inc/somefile.cfm",
data: dataString,
cache: false,
success: function(html){
$('#'+findDiv).html(html);
}
});
});
});
</script>
Is there a way to show data to the user while the data is streaming into a <div>
?