moved script hunks after body tag to allow chrome working
[xynt.git] / web / test-hs-rd.php
1 <html>
2 <head>
3 <script type="text/javascript" src="xynt/xynt-console.js"></script>
4 <script type="text/javascript" src="xynt/xynt-http-streaming-ifra.js"></script>
5 <script type="text/javascript">
6 var http_streaming = "ready";
7 var ctx_new = "";
8
9 window.onload = function () { if (http_streaming != "ready") http_streaming.reload(); };
10 </script> 
11 </head>
12 <body>
13 </body>
14 <?php
15 function mop_flush()
16 {
17     ob_flush();
18     flush();
19 }
20
21 function main()
22 {
23     $s = "";
24     for ($i = 0 ; $i < 4096 ; $i++) {
25         $s .= rand(65,90);
26     }
27     for ($i = 0 ; $i < 15 ; $i++) {
28         // if ($i == 0)
29         //    sleep(1);
30      
31         if ($i != 8) {
32             printf("<script id='hs%d' type='text/javascript'>
33 push(\"$('cont').innerHTML = '%d';\");
34 </script>", $i, $i);
35         }
36         else {
37             // exit();
38             // sleep(30);
39         }
40         if ($i == 0)
41             printf("<!-- %s -->", $s);
42         mop_flush();
43         usleep(1000000);
44     }
45 }
46 main();
47 ?>
48 </html>