workaround implemented to avoid IE7 scope reset
[xynt.git] / web / test-hs-rd.php
index 67bc876..bfa7544 100644 (file)
@@ -1,13 +1,10 @@
 <html>
 <head>
 <script type="text/javascript" src="xynt/xynt-console.js"></script>
-<!-- <script type="text/javascript">
-window.onload_old = function() {
-    // parent.ifra.contentWindow.location.href = 'winstream_rd.php';     
-     window.location.href = 'winstream_rd.php';     
-}
-
-</script> -->
+<script type="text/javascript">
+var http_streaming = "ready";
+window.onload = function () { if (http_streaming != "ready") http_streaming.reload(); };
+</script> 
 <?php
 function mop_flush()
 {
@@ -21,23 +18,18 @@ function main()
     for ($i = 0 ; $i < 4096 ; $i++) {
         $s .= rand(0,255);
     }
-    for ($i = 0 ; $i < 300 ; $i++) {
+    for ($i = 0 ; $i < 20 ; $i++) {
         
-        /*                    parent.document.getElementById('cont').innerHTML = \"%d\";
-                             parent.allmythings =  \"%d\"; */
-        if ($i != 350) {
-            printf("<script id=\"hs%d\" type=\"text/javascript\">
-                    parent.allmythings = %d;
-                    console.log(\"zorro \"+parent.allmythings);
-
-                </script>", $i, $i);
+        if ($i != 18) {
+            printf("<script id='hs%d' type='text/javascript'>
+if (http_streaming != 'ready') {
+    http_streaming.keepalive();
+}
+</script>", $i, $i);
         }
         else {
-            printf("<script id=\"hs%d\" type=\"text/javascript\">
-                    parent.allmythings = %d;
-                    console.log(\"zorro \"+parent.allmythings);
-                    parent.document.location.assign('winstream2.php');
-                </script>", $i, $i);
+            // exit();
+            sleep(30);
         }
         if ($i == 0)
             printf("<!-- %s -->", $s);