javascript - PHP function fails to return correct result after ~1000 ajax posts -
i'm debugging code , in order repeatedly making ajax post php script on localhost apache24 server. in simple terms, php script takes integer value , returns different data string depending on input integer.
i'm stepping through numerous integer values loop on javascript side, starting @ x=1. i've noticed, however, after ~980 ajax posts, php function stops returning correct data; seems return data x = 980, x continues increment. console.log confirms x value doesn't hang @ 980.
i thought maybe script buggy restarted loop @ x = 980 and, sure enough, php script worked fine until x = ~1900, when stopped working again.
is there reason php script fails work after ~980 requests? have received no errors on either web side or server side.
function interpretdisplay(input_string) { var display = input_string.split("?"); (var x = 0; x < 16; x++) { document.getelementbyid("ids").innerhtml = display + " "; } } function rundisplay(x) { values[1]+= "&seed=" + x; $.post("test.php", values[1], function(data) { console.log(x); if (x % 1 == 0) { interpretdisplay(data); } if (x < 1000) { settimeout(function() { rundisplay(x+1); } , 10); } }); } var url = window.location.href; var values = url.split('?'); rundisplay(1);
Comments
Post a Comment