During a document.ready, I call the "load_result" function outlined below:
function load_result()
{
$.getJSON( "http://www.mywebsite.com/loadresult.php", function(data) {
if( data == undefined )
{
null_count++;
return;
}
console.log( data );
insert_result( data );
setTimeout( "load_result", 500 );
} );
}
However, this works sporadically.. sometimes, it calls insert_result
properly, and other times it doesn't. Any tips?