This script displays the correct result only once and then the browser still “Connecting…”
$(document).everyTime(1000, 'controlled', function() {
$.ajax({
type: 'GET',
url: 'sisplits2.log',
dataType: 'text',
async: 'false',
success: function(data){
array = data.split('-');
}
});
});
$(document).everyTime(1000, 'controlled', function() {
var j = array.length;
var i = 0;
$('#vory').html(function(){
while (i<j){
document.write(array[i]);
document.write("<br />");
i++;
}
});
});
I don’t understand why you have two timer loops here. Why not do all of the printing in your callback function?
Also, as has been stated in the comments to the question, document.write is not valid after the page has loaded. Instead, use jQuery to append/replace to your
#voryelement:Example: http://jsfiddle.net/j6WuV/1/
The example is similar, with modifications for jsfiddle, and use of setInterval instead of
everyTime.