Yes, that's what, theoretically, should be used. You're right. However, it doesn't work in some versions of Internet Explorer, as always. So be careful. You may need to fall back on arguments.callee
, or, rather, a simple:
function callback() {
// ...
setTimeout(callback, 100);
}
setTimeout(callback, 100);
Which does work on IE.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…