I'm trying to refresh the same page but it isn't working. This is my HTML code:
<html> <head> <title>HTML in 10 Simple Steps or Less</title> <meta http-equiv=”refresh” content=”5" /> </head> <body> </body> </html>
Refreshing part of a page periodically You can use the frame “reload” function periodically in frameset page itself. In the above code, “right_frame” reloads every second. setInterval() function is very closely related to setTimeout() – both have similar syntax: setInterval ( expression, interval );
In HTML and XHTML, one can use the meta element with the value of the http-equiv attribute set to " Refresh " and the value of the content attribute set to "0" (meaning zero seconds), followed by the URI that the browser should request.
The <meta http-equiv="refresh"> tag causes a web page to refresh automatically after a specified amount of time.
It looks like you probably pasted this (or used a word processor like MS Word) using a kind of double-quotes that are not recognized by the browser. Please check that your code uses actual double-quotes like this one "
, which is different from the following character: ”
Replace the meta tag with this one and try again:
<meta http-equiv="refresh" content="5" >
You're using smart quotes. That is, instead of standard quotation marks ("
), you are using curly quotes (”
). This happens automatically with Microsoft Word and other word processors to make things look prettier, but it also mangles HTML. Make sure to code in a plain text editor, like Notepad or Notepad2.
<html> <head> <title>HTML in 10 Simple Steps or Less</title> <meta http-equiv="refresh" content="5"> <!-- See the difference? --> </head> <body> </body> </html>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With