如何在不刷新页面的情况下重新启动内容? [英] How do I restart content without refreshing the page?

查看:115
本文介绍了如何在不刷新页面的情况下重新启动内容?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在制作一个快速的JS网络应用程序,我希望能够在不重新加载网页的情况下重新启动应用程序。这样,浏览器每次想要重新启动应用程序时都不需要再次获取资源,并且无需访问Internet即可重新启动。

解决方案

  window.location.reload(假); 

false 标志将重新执行网站没有从本地缓存的网页上重新加载任何东西。您还可以传递 true ,这将重新加载所有资源。


I am making a quick JS web-application, and I want to be able to restart the application without actually reloading the webpage. This way, the browser won't need to get the resources again every time they want to restart the app and they can restart without internet access.

解决方案

window.location.reload(false);

The false flag will re-execute the website without reloading anything from the web which is cached locally. You can also pass true which will reload all resources.

这篇关于如何在不刷新页面的情况下重新启动内容?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆