Join WhatsApp ChannelJoin Now

Automatically Refresh And Reload Page

In this article, we will show you Automatically Refresh And Reload Page – JQuery. This article will give you simple example of Automatically Refresh And Reload Page – JQuery. you will learn Automatically Refresh And Reload Page – JQuery.

I will give you three example for how to Automatically Refresh And Reload Page. So let’s see the bellow example:

Example:- 1 (Using setTimeout)

<!DOCTYPE html>
<html>
<head>
    <title>Page Reload after 10 seconds - codeplaners.com</title>  
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.js"></script>
</head>
<body>
    <h2>Hello Codeplaners</h2>
    <script type="text/javascript">
        setTimeout(function(){
            location.reload();
        },15000);
    </script>
</body>
</html>

Example:- 1 (Using setInterval)

<!DOCTYPE html>
<html>
<head>
    <title>Page Reload after 10 seconds - codeplaners.com</title>
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.js"></script>
</head>
<body>
    <h2>Hello Codeplaners</h2>
    <script type="text/javascript">
        function autoRefreshPage()
        {
            window.location = window.location.href;
        }
        setInterval('autoRefreshPage()', 15000);
    </script>
</body>
</html>

Example:- 1 (Using meta)

<!DOCTYPE html>
<html>
<head>
    <title>Page Reload after 10 seconds - codeplaners.com</title>  
    <meta http-equiv="refresh" content="10" />
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.js"></script>
</head>
<body>
    <h2>Hello Codeplaners</h2>
</body>
</html>

Recommended Posts