setInterval does not seem to be working?

前端 未结 2 563
伪装坚强ぢ
伪装坚强ぢ 2021-01-28 12:44

This code does not seem to be working. I am trying to create a dynamic list of chat rooms available that updates every 10 seconds. I also want the user to be able to set peramin

相关标签:
2条回答
  • 2021-01-28 13:13

    Try putting quotes around your function:

    setInterval('setRooms()', 10000);
    

    Alternatively change your method to:

    var setRooms = function()
    

    and you can then use:

    setInterval(setRooms, 10000);
    
    0 讨论(0)
  • 2021-01-28 13:26

    setInterval(setRooms, 10000);

    0 讨论(0)
提交回复
热议问题