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().
javascript
jquery
function
browser
methods
Share
Improve this question
asked Sep 21, 2013 at 17:02
BlueMarkBlueMark97244 gold badges2424 silver badges4141 bronze badges7
2stop stops any current downloads. So what do you expect to happen when you "unstop"?
– Dave
CommentedSep 21, 2013 at 17:05
1window.location.reload();
– Dave
CommentedSep 21, 2013 at 17:10
1I don't think it is possible
– Andrey M.
CommentedSep 21, 2013 at 20:24
2You 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
CommentedSep 21, 2013 at 21:13
1window.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
CommentedSep 24, 2013 at 7:01
|
Show 2 more ments
1 Answer
1
Reset to default
5
I 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.