簡體   English   中英

PHP-自動刷新頁面不起作用

[英]PHP- auto refresh page did not work

我需要一個頁面來不斷自動刷新。 刷新代碼在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>

display.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。 僅用於元標記。 每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>

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM