我需要一个页面来不断自动刷新。刷新代码在display.php文件中。当我在浏览器上运行该文件时,它工作得很好。但是当我通过文件list.php点击按钮打开它时,它根本没有刷新。我的代码有问题吗??或者代码有一个使其工作的条件?
list.php
<div data-role="content">
<ul data-role="listview">
<li><a href="display.php">Taman</a></li>
<li><a href="#page3">Page Three</a></li>
<li><a href="#page4">Page Four</a></li>
</ul>
</div>
显示.php
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" http-equiv=refresh content="1; url=<?php echo $_SERVER['PHP_SELF']; ?>">
<title>jQuery Mobile Web App</title>
浏览器(如何显示内容或重新加载页面)、搜索引擎(关键字)或其他web服务都可以使用元数据。
如果您只是刷新,那么就不需要使用php作为url。只用于meta标签。在这里,页面将每30秒重新加载一次
<meta http-equiv="refresh" content="30">
希望这对你有帮助。
Tips and Notes
Note: <meta> tags always goes inside the <head> element.
Note: Metadata is always passed as name/value pairs.
Note: The content attribute MUST be defined if the name or the http-equiv attribute is defined. If none of these are defined, the content attribute CANNOT be defined.
你能试试这个吗。
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" http-equiv="refresh" content="30; url=<?php echo $_SERVER['PHP_SELF']; ?>">
<title>jQuery Mobile Web App</title>