如何自动刷新ejs页面 [英] How to automatically refresh ejs page
本文介绍了如何自动刷新ejs页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我是ejs的新人。正在尝试一个应用程序。我想每5秒更新一次页面。
Im new with ejs. As I was trying out an app. I want to refresh the page every 5 sec.
我收到了一个代码
<script language="javascript" type="text/javascript">
$(document).ready(function() {
setInterval("location.reload(true)", 5000);
});
</script>
但是如何在ejs中包含jquery?如何在ejs页面中嵌入此代码?
But how to include jquery in ejs? How to embed this code in ejs page?
推荐答案
试试这个
标签:< meta http-equiv =refreshcontent =5>。
这很简单。 5是秒数。如果你想增加说20分钟的时间,你只需输入1200等等。
tags: <meta http-equiv="refresh" content="5">.
That simple. The "5" is the number of seconds. If you want to increase the time to say 20 minutes, you simply put in "1200" and so on.
这篇关于如何自动刷新ejs页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文