I have a PeriodicalUpdater that when ran calls a php page. this page then returns three values in a string something like active|102|56|johnDoe How do I get these values from the response so I can run javascript logic against them new Ajax.PeriodicalUpdater("", "user.php", { // initial number of seconds interval between calls frequency : 60, decay : 1.2, onComplete: function(results) { if (200 == results.status) { var rsp_str = results.responseText; var ids = rsp_str.split("|"); if(ids[0] != "active") { alert(''Got Here''); var url = "messagePop.php?user=" + ids[1] + "&id=" + ids[2] + "&name=" + ids[3]; testwindow= window.open (url, "mywindow","location=0,status=0,scrollbars=0,width=400,height=320"); testwindow.moveTo(0,0); } } } }); --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
On Tue, Jun 17, 2008 at 1:07 PM, seran128 <jeff.webdeveloper-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > I have a PeriodicalUpdater that when ran calls a php page. this page > then returns three values > in a string something like active|102|56|johnDoe > How do I get these values from the response so I can run javascript > logic against themWell, you can''t use onComplete with Ajax.PeriodicalUpdater. The docs say that "the onComplete callback is hijacked to be used for update management....". However, you _can_ use the onSuccess callback (in which case, you don''t need to check if response.status == 200--but heck, with Prototype you don''t really need to do that anyway). The pertinent docs: http://prototypejs.org/api/ajax/periodicalUpdater (check the section at the very bottom of the page, "Beware! Not a specialization!" Good luck! :Dan --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---