簡體   English   中英

使用PHP自動刷新div

[英]Auto Refresh div using php

我在使用mvc模式使用自動刷新div標簽時遇到問題。 請幫助我...這是我的代碼... one1.php包含的文件名:

 <?php 
    $textnameObj = new textname();
    $textname = $textnameObj->getCont('status','1');
    echo $textname['details'];
    ?>

在index.php中調用包含的文件名:

<html>
<head>
    <script type="text/javascript">
      setInterval("$('#autoref').load('includes/one1.php');", 10000);
    </script>
</head>
<body>
<div id="autoref">
   <?php include('includes/one1.php'); ?>
</div>
</body></html>

而第二次刷新時出現此錯誤...致命錯誤:在第2行的include / one1.php中找不到類'textname'

index.php您包括了textname類文件。 但是,如果要單獨調用includes/one1.php ,則不會定義類textname

includes/one1.php ,你必須include_once一個文件,其中textname類的定義。

暫無
暫無

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

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