this code may be fine in the browser, but on the H5 interface on the mobile side, the loop will always fail to stop
function zhuajiu(userid) {
var timesRun = 0;
var ran = 0;
var time = setInterval(function() {
ran = Math.random() * 100; //[0,range)
var result = parseInt(ran); //
$(".lotid").html(result);
timesRun += 1;
if(timesRun === 10) {
alert(11);
clearInterval(time);
}
}, 50);
}
Thank you for your help. A global variable has been contaminated.