Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Auto refresh code in HTML using meta tags

Tags:

html

meta

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> 
like image 836
Sourabh Avatar asked Jan 03 '12 11:01

Sourabh


People also ask

How do I automatically refresh part of an HTML page?

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 );

How do I refresh meta tags?

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.

Which HTML tag will you use to refresh a web page every 2 minutes?

The <meta http-equiv="refresh"> tag causes a web page to refresh automatically after a specified amount of time.


2 Answers

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" > 
like image 107
Dennis Traub Avatar answered Nov 15 '22 08:11

Dennis Traub


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> 
like image 42
benesch Avatar answered Nov 15 '22 10:11

benesch