You don't need jquery for this, in plain javascript, the following will work!(您不需要为此使用纯JavaScript的jquery,以下方法将起作用!)
window.setInterval(function(){
/// call your function here
}, 5000);
To stop the loop you can use(要停止循环,您可以使用)
clearInterval()
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…