Couple things...
First, in your Event.observe call, remove the parenthesis from
doUpdate() so you pass the function itself rather than calling it.
Second, you don't actually need to use the load event since your JS
follows the "time" div. The div has been loaded into the DOM, so you
can go ahead and reference it. If you put your script in the header
(which I would), then you need the load event.
All that said, your code should still create the PeriodicalUpdater.
Make sure you're not getting a security warning in IE, and also try
retrieving a static text file.
On Jun 12, 7:56 am, Gerrit <[EMAIL PROTECTED]> wrote:
> Hi!
> I spent 2 days now, getting Ajax.PeriodicalUpdater working with IE,
> but I had no success. There is no problem with Firefox or Konqueror
> and it works as aspected.
> In IE the content (output from a php script) is downloaded once, but
> never gets updated after that. Interestingly enough the content gets
> updated when I open the php script in another browser window and
> update it. There seems to be a problem with caching!?
> At first I thougt this is a general problem with IE, but using
> equivalent code with mootools, the content gets updated periodically!
>
> Is this a bug or am I just terribly stupid? ;-)
> You can find my test code below
> ----------------------------
> <html>
> <head>
> <title>test</title>
> <META HTTP-EQUIV="Expires" CONTENT="Tue, 01 Jan 1980 1:00:00 GMT">
> <META HTTP-EQUIV="Pragma" CONTENT="no-cache">
> <script type="text/javascript" src="prototype.js"></script>
> </head>
>
> <body>
> <div id="time"></div>
> <script type="text/javascript">
> Event.observe(window, 'load', doUpdate(), false);
> function doUpdate() {
> new Ajax.PeriodicalUpdater('time', 'time.php',
> {
> method: 'get',
> frequency: 1
> });}
>
> </script>
> </body>
> </html>
> ----------------------------
> time.php just contains <?php echo date("H:i:s"); ?>
--~--~---------~--~----~------------~-------~--~----~
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 [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---