currrent window refreshing

You must Login before you can answer or comment on any questions.

I am developing an app that is fetching information from an API. I want to refresh the current window every 10 sec so as to check for new messages. The page should be refreshed in the background.

2 Answers

Sorry,You mean,You want to hot your API for checking Updates after every 10 Sec.if this is the case,then no need to refresh the window,Just use setTimeout,where you are hitting your APi,Your Window will show you,Updated data.

Might it helps. Thanks.

— answered 9 months ago by pankaj Goyal
answer permalink
2 Comments
  • i used the set interval option and the page refresh in the time specified.But it finally crashes when the window is open for a longer time. so would like to knw if there is any alternate method for doing this

    — commented 9 months ago by manu george

  • I guess,Your application is crashing,beacuse you are giving a small interval time.So ,might be,Before Refershing,It again go for API hit.So Can you Please check for a longer interval time.Meanwhile,I am looking for any alternate solution.

    Thanks

    — commented 9 months ago by pankaj Goyal

Your app crashes because you have memory leaks, not because of the small interval time. Also you should refresh the window only if the data you get through the API has something new to show.

Your Answer

Think you can help? Login to answer this question!