使用元标记自动刷新 HTML 中的代码

我试图刷新同一个页面,但是没有用。这是我的 HTML 代码:

<html>
<head>
<title>HTML in 10 Simple Steps or Less</title>
<meta http-equiv=”refresh” content=”5" />
</head>
<body>


</body>
</html>
517054 次浏览

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>

The quotes you use are the issue:

<meta http-equiv=”refresh” content=”5" >

You should use the "

<meta http-equiv="refresh" content="5">
<meta http-equiv="refresh" content="600; url=index.php">

600 is the amount of seconds between refresh cycles.

Try this tag. This will refresh the index.html page every 30 seconds.

<meta http-equiv="refresh" content="30;url=index.html">

Try this:

<meta http-equiv="refresh" content="5;URL= your url">

or

<meta http-equiv="refresh" content="5">