Greetings,
I''m just learning but I don''t see why this doesn''t
work.
I''m using plain html and prototype 5.0. Nothing fancy.
There are two files. x.html and y.html.  The test was to see if I
could periodically dump y.html into a region of x.html.
y.html in its entirety is ''<p>Test paragraph.</p>''
My drill was to read y.html a number of times, update a monitor
paragraph each time and store the results of each read in a different
paragraph.
It works as I expected in FF(1.5,1.6 & 2.0).  It doesn''t work for
me
wit IE(6 & 7).  In IE there are no errors.  It updates the monitor
once, the dump never.
I notice that the result of last read is not dumped into the holding
element.  I presume that that has to do with the status being set
before it updates.  Could that be having the baleful effect on IE?
I''ve tried it asynchronous = true/false and it doesn''t matter.
x.html is:
<html>
  <head>
    <title>Test Page</title>
    <script src="/javascripts/prototype.js"
type="text/javascript"></
script>
  </head>
  <body>
    <h1>test</h1>
    <div id="notice" class="error"></div>
    <p>line 0:<span id="testdiva"
class="testdiv"></span></p>
    <p>line 1:<span id="testdivb"
class="testdiv"></span></p>
    (<p id="holddiv"></p>)
    <script type="text/javascript">
      var counter = 0;
      var X = document.getElementsByClassName(''testdiv'');
      for (i=0; i < X.length; i++ ) {
        counter += 1;
        Element.update(X[i], ''This is a test preload: ''+i);
      }
      var tmptest = new Ajax.PeriodicalUpdater(
        { failure: ''notice'',
          success: ''holddiv''
        },
        ''y.html'',
        { frequency: 5,
          insertion: Insertion.Bottom,
          onSuccess:   function() {
            var x = $(''testdiva'');
            var t = x.innerHTML;
            Element.update( x, t+"<br/>count: "+counter);
            if ( ++counter >= 6 ) {
              tmptest.stop();
            }
          }
        }
     );
   </script>
  </body>
</html>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Spinoffs" group.
To post to this group, send email to
rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---