jquery - What is the opposite of javascript window.stop() - Stack Overflow

Once I've executed window.stop(), how can I resume default actions?I need to make toggleswitch fu

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().

Share Improve this question asked Sep 21, 2013 at 17:02 BlueMarkBlueMark 9724 gold badges24 silver badges41 bronze badges 7
  • 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
 |  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.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745123898a4612578.html

相关推荐

  • jquery - What is the opposite of javascript window.stop() - Stack Overflow

    Once I've executed window.stop(), how can I resume default actions?I need to make toggleswitch fu

    6小时前
    10

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信