Once I've executed window.stop()
, how can I resume default actions?
I need to make toggle/switch function, that once fired will run window.stop()
, and with second run will recover window actions disabled by window.stop()
.
Once I've executed window.stop()
, how can I resume default actions?
I need to make toggle/switch function, that once fired will run window.stop()
, and with second run will recover window actions disabled by window.stop()
.
-
2
stop
stops any current downloads. So what do you expect to happen when you "unstop"? – Dave Commented Sep 21, 2013 at 17:05 -
1
window.location.reload();
– Dave Commented Sep 21, 2013 at 17:10 - 1 I don't think it is possible – Andrey M. Commented Sep 21, 2013 at 20:24
- 2 You could implement a limited form yourself by looping through all images on the page and toggling their URL if they haven't fully loaded, but that may not work in all browsers. I certainly don't know any inbuilt method. Remember that stopping and pausing are very different ideas. – Dave Commented Sep 21, 2013 at 21:13
- 1 window.stop() will stop all request currently executing unless the resource your are trying to restart knows how to resume i.e based on some form of session data,calling window.location.reload() will restart the request a fresh assuming the request has not been cached by the browser.To better answer your question you need to define what you mean by "recover". – mujib ishola Commented Sep 24, 2013 at 7:01
1 Answer
Reset to default 5I misunderstood before how window.stop() works.
I was wrong, there are no any "direct inbuilt" javascript method to reload ONLY THESE ELEMENTS stopped by window.stop(), so by this meaning it's impossible.
However, if it's needed, we can:
- loop through each element on the site by our own function
- cut website in sections, and load them one by one with ajax, so we will have to reload only specific sections --but I think either one of these it's too plex to implement to be worthy
So, to "pause website for moment" window.stop() it's not good choice.