Here are two files ( one html and one .php file). I'm trying to get
backend.php to send text to the .html file but nothing happens. Does
anyone know what is wrong with this or how to debug it?

thanks,
Bob



here is the html file:
-------------------------

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/
TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml";>
<head>
   <title>Collecting Data...</title>
   <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/

   <script type="text/javascript" src="jquery-1.3.2.min.js"></script>
</head>
<body>

<div id="comet_frame" style="display:none;visibility:hidden"></div>
<div id="content"></div>

<script type="text/javascript">
   var comet = {
      load: function() {
         $("#comet_frame").html('<iframe id="comet_iframe"
src="backend.php"></iframe>');
      },

      unload: function() {
         $("#comet_frame").html('<iframe id="comet_iframe" src=""></
iframe>');
      },

      clearFrame: function() {
         $("#comet_iframe").html("");
      },

      time: function(ctime) {
         $("#content").html(ctime);
      }
   }

   $(document).ready(function() {
      comet.load();
   });

</script>

<body>
</body>
</html>

here is backend.php:
----------------------

<?php
   set_time_limit(0);
   header("Cache-Control: no-cache, must-revalidate");
   header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
   flushHard();

   $x = 0;

   while(1) {
      if($x == 10) {
         echo '<script type="text/javascript">parent.comet.clearFrame
();</ script>' . "\n";
      }
      else {
         echo '<script type="text/javascript">parent.comet.time("' .
date('H:i:s') . '");</script>' . "\n";
      }
      flushHard();
      ++$x;
      sleep(1);
   }
   echo '<script type="text/javascript">parent.comet.unload();</
script>' . "\n";
?>

Reply via email to