简体   繁体   English

有没有不使用jQuery刷新页面的方法吗?

[英]Is there a way to refresh page without using jQuery?

I'm still looking for way to automate refresh in my page. 我仍在寻找自动刷新页面的方法。 But I'm confused on how to solve this problem without using jQuery and solving it using Laravel 5.3 functions. 但是我很困惑如何不使用jQuery并使用Laravel 5.3函数来解决此问题。 If someone knows how to solve this please help. 如果有人知道如何解决此问题,请提供帮助。 It would be great. 这会很棒。 Thanks in advance. 提前致谢。

this is JavaScript basics. 这是JavaScript的基础知识。

Try this: 尝试这个:

<body onload="if (location.href.indexOf('reload')==-1) location.replace(location.href+'?reload');">

header("Refresh:0"); should do the trick. 应该可以。 (In PHP) (在PHP中)

location.reload(); should do it in plain old js. 应该在普通的旧js中完成。

These are the way you can reload page : 这些是您可以重新加载页面的方式:

window.location.reload(); window.location.reload(); in JavaScript 在JavaScript中

in HTML (where 1 = 1 second). 在HTML中(其中1 = 1秒)。

window.location.reload() window.location.reload()

location.reload(true/false); location.reload(true / false); If false, the page will be reloaded from cache, else from the server. 如果为false,则将从缓存中重新加载页面,否则将从服务器中重新加载。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM