Hello I am getting my browser crashed everytime I use this while loop. I tried this also with strings. By this I mean to put in variable string and go inside the loop, after the post returns an agreed value, the value in the variable should be rewritten and the loop should end. But it causes the browser to crash.
var check = 1;
while (check < 2) {
inm = 'NOINM-'+Math.floor(100000 + Math.random() * 900000);
$.post('oneclickupdate.php', {function:'check_duplicity', inm:inm}, function(data){
if (data === 'no')
{
$('#1').val(inm);
check = check + 1;
}
else if(data === 'yes')
{
check = 1;
}
});
}