setInterval stops after Ajax request

前端 未结 7 2154
不知归路
不知归路 2021-01-03 15:50

I\'m using Asp.net MVC and I want my partial view to refresh on an interval, which it does until I make an unrelated Ajax request, then it stops.

Here are a few simp

7条回答
  •  渐次进展
    2021-01-03 16:22

    Wrapping ajaxRefresh in an anonymous function and calling it with parentheses works for me. So your second-last line of code would be like setInterval(function () { ajaxRefresh() }, 1000).

    I don't understand it either.

提交回复
热议问题