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 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 -~----------~----~----~----~------~----~------~--~---
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 <Evil.Ger...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> 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 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 -~----------~----~----~----~------~----~------~--~---
Thanks for your message! I have changed the html file to your suggestions, but the container still doesn''t get updated in IE. I have also tried a static text file and changed it while IE was running but it still showed the old value. But I have found something else interesting, if you clear IE''s cache, the value gets updated once. It would be very nice if anybody else could try this and say if it works or not. I have no further ideas... Just to make sure I got you right Adam, this is the changed html file: ---------------------------- <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> <script type="text/javascript"> Event.observe(window, ''load'', doUpdate, false); function doUpdate() { new Ajax.PeriodicalUpdater(''time'', ''test.txt'', /*new Ajax.PeriodicalUpdater(''time'', ''time.php'',*/ { method: ''get'', frequency: 1 }); } </script> </head> <body> <div id="time"></div> </body> </html> ---------------------------- On 15 Jun., 16:43, Adam McCrea <adam.mcc...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> 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.--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Sound like you''re not setting up correct headers on your server. Have a look at this: http://en.wikipedia.org/wiki/XMLHTTP#Microsoft_Internet_Explorer_cache_issues Please close the trac ticket you reopened if that solves your issue. Thank you. On Jun 16, 7:41 am, Gerrit <Evil.Ger...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:> Thanks for your message! > I have changed the html file to your suggestions, but the container > still doesn''t get updated in IE. > I have also tried a static text file and changed it while IE was > running but it still showed the old value. > But I have found something else interesting, if you clear IE''s cache, > the value gets updated once. > It would be very nice if anybody else could try this and say if it > works or not. I have no further ideas... > > Just to make sure I got you right Adam, this is the changed html file: > ---------------------------- > <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> > > <script type="text/javascript"> > Event.observe(window, ''load'', doUpdate, false); > function doUpdate() { > new Ajax.PeriodicalUpdater(''time'', ''test.txt'', > > /*new Ajax.PeriodicalUpdater(''time'', ''time.php'',*/ > > { > > method: ''get'', > > frequency: 1 > > }); > } > > </script> > </head> > > <body> > > <div id="time"></div> > > </body> > > </html> > ---------------------------- > > On 15 Jun., 16:43, Adam McCrea <adam.mcc...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > 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.--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Yes, it works now! :) Thank you very much Tobie, this problem has driven me insane... I think this should be mentioned in the API Docs or sowewhere else! If you are not familiar with that, you will probably never find that out on your own. On 18 Jun., 22:07, tobie <tobie.lan...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Sound like you''re not setting up correct headers on your server. > > Have a look at this:http://en.wikipedia.org/wiki/XMLHTTP#Microsoft_Internet_Explorer_cach... > > Please close the trac ticket you reopened if that solves your issue. > > Thank you. > > On Jun 16, 7:41 am, Gerrit <Evil.Ger...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote: > > > Thanks for your message! > > I have changed the html file to your suggestions, but the container > > still doesn''t get updated in IE. > > I have also tried a static text file and changed it while IE was > > running but it still showed the old value. > > But I have found something else interesting, if you clear IE''s cache, > > the value gets updated once. > > It would be very nice if anybody else could try this and say if it > > works or not. I have no further ideas... > > > Just to make sure I got you right Adam, this is the changed html file: > > ---------------------------- > > <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> > > > <script type="text/javascript"> > > Event.observe(window, ''load'', doUpdate, false); > > function doUpdate() { > > new Ajax.PeriodicalUpdater(''time'', ''test.txt'', > > > /*new Ajax.PeriodicalUpdater(''time'', ''time.php'',*/ > > > { > > > method: ''get'', > > > frequency: 1 > > > }); > > } > > > </script> > > </head> > > > <body> > > > <div id="time"></div> > > > </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 -~----------~----~----~----~------~----~------~--~---
Hi, I''m in the same fix. I read the wikipedia link above, but I didn''t understand how to relate that to code using Prototype. Could you clarify what you have done to make your application work? For reference, my code is: <script type="text/javascript" language="javascript" src="prototype.js"></script> <script type="text/javascript" language="javascript"> obj = new Ajax.PeriodicalUpdater( ''sum_display'', ''reader.php'', { method: ''get'', parameters: {file : ''cache.html''}, frequency: 60 } ); </script> Where does the script described in the wikipedia page fit into that? Thanks in advance for explanations --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Hi Francois! The Wikipedia page has been changed. Please have a look at the old archived page: http://en.wikipedia.org/w/index.php?title=XMLHttpRequest&oldid=141468975 On 4 Jul., 09:05, Francois <sut...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi, > > I''m in the same fix. I read the wikipedia link above, but I didn''t > understand how to relate that to code using Prototype. Could you > clarify what you have done to make your application work? > > For reference, my code is: > > <script type="text/javascript" language="javascript" > src="prototype.js"></script> > <script type="text/javascript" language="javascript"> > obj = new Ajax.PeriodicalUpdater( > ''sum_display'', > ''reader.php'', > { > method: ''get'', > parameters: {file : ''cache.html''}, > frequency: 60 > } > ); > </script> > > Where does the script described in the wikipedia page fit into that? > > Thanks in advance for explanations--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Yes, that looks much clearer! Thanks a lot. François --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---