How do I refresh my html page every 2 mins?
You can use:
<meta http-equiv="refresh" content="120">
The
<meta http-equiv="refresh">
tag causes a web page to refresh
automatically after a specified amount of time. Users generally don't
expect automatic refreshes, so they can be disorienting. Refreshing
also moves focus to the top of the page, which may frustrate or
confuse users, particularly those who rely on screen readers or other
assistive technologies.
- https://web.dev/meta-refresh/
- Meta equiv refresh
HTML meta stop auto refresh after onclick button
Use JS for that:
var timer = setTimeout(function () {
window.location.reload()
}, 60000);
This code will reload your webpage after 60 milliseconds.
You can cancel reload using it's reference timer
:
clearTimeout(timer);
Refresh HTML page automatically
There are known problems where this will not work with some versions of IE. There is a kind of hack where you put a second head section containing the appropriate meta tag, at the end of the HTML document.
Refresh HTML Page in Browser Automatically on Timer - Every 15 Min
Place this inside <head>
to refresh page after 900 seconds:
<meta http-equiv="refresh" content="900"> <!-- Refresh every 15 minutes -->
For what it's worth, the w3c has officially deprecated this feature, but browsers continue to support this feature. For your purposes, this is an ideal solution. It's just not a recommended solution for "public" (www)-facing web sites any more.
Related Topics
How to Create Links With 'Target="_Blank"' in Markdown
How to Update Non-Jsf Components (Plain Html) With Jsf Ajax
Text-Overflow Is Not Working When Using Display:Flex
Imitating a Blink Tag With Css3 Animations
Use Font Awesome Icon in Placeholder
Using "Margin: 0 Auto;" in Internet Explorer 8
How to Get Folder Directory from HTML Input Type "File" or Any Other Way
Angular 5 Formgroup Reset Doesn't Reset Validators
Why Would a Developer Place a Forward Slash At the Start of Each Relative Path
Displaying Unicode Symbols in Html
Youtube Autoplay Not Working on Mobile Devices With Embedded Html5 Player
Stretch Text to Fit Width of Div
Float Does Not Work in a Flex Container
Format HTML Table Cell So That Excel Formats as Text