Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to automatically refresh ejs page

Im new with ejs. As I was trying out an app. I want to refresh the page every 5 sec.

I got a code

<script language="javascript" type="text/javascript">
        $(document).ready(function() {
            setInterval("location.reload(true)", 5000);
        });   
</script>

But how to include jquery in ejs? How to embed this code in ejs page?

like image 632
Okky Avatar asked Oct 15 '25 03:10

Okky


1 Answers

Try this

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.

like image 195
Jetson John Avatar answered Oct 16 '25 15:10

Jetson John



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!