Yuan Yudistira
2008-May-19 09:11 UTC
Ajax.request , Automatic JavaScript response evaluation
Hi,.. how are you everyone? I am playing with Scrip.aculo.us Sortable feature. I think I get browser related problems. I use prototype 1.6, and fire a request, and return a piece of HTML coder along with Javascript to create a sortable list. (I user .update function) I check on my FF 2.0, The sortable works just fine. no error or warning appear on FireBug . But when I try using IE 7.0, the list can be sort / drag and drop. Any suggestion what to look for for this problems? I appreciate for any suggestion ... Thanks YUAN -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ "Limitless undying love which shines around me like a million suns It calls me on and on across the universe...." Accross The Universe - The Beatles - -------------------------------------------- Visit : http://www.sabukhitam.com/ ===================== --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Rudy Susanto
2008-May-19 11:33 UTC
Re: Ajax.request , Automatic JavaScript response evaluation
Yes, responseText will automatically evaluated by Prototype. If you just want to display HTML fragment and execute script later, your code should look like this: $(container).update(responseText.stripScripts()); responseText.extractScripts().each(function(script){ if (window.execScript) window.execScript(script); // MSIE else window.eval(script); // Mozilla Firefox }); Yuan Yudistira wrote:> Hi,.. > how are you everyone? > > I am playing with Scrip.aculo.us <http://Scrip.aculo.us> Sortable > feature. > > I think I get browser related problems. > > I use prototype 1.6, and fire a request, and return a piece of HTML > coder along with > Javascript to create a sortable list. (I user .update function) > > I check on my FF 2.0, The sortable works just fine. no error or > warning appear on FireBug . > > But when I try using IE 7.0, the list can be sort / drag and drop. > > Any suggestion what to look for for this problems? > > I appreciate for any suggestion ... > > > Thanks > > YUAN >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
yuan yudistira
2008-May-19 11:39 UTC
Re: Ajax.request , Automatic JavaScript response evaluation
Hi Rudy, Thanks for the reply. Pardon me if my question is not very clear. My problem is that it seems that the script is not automatically evaluated by prototype in IE7. (the sortable element can be drag and drop) Now I get another clue after installing IEWebDeveloper v2, I get error message : *Expected identifier, string or number* and here is a piece of js code i have : var coreAppObj = { autoSearch:function() { var url ='' http://localhost/eventManager/index.php/welcome/searchGuest/''; new Ajax.Request(url, { method: ''post'', evalJS: ''true'', postBody: ''searchguestname=''+$F(''searchguestname''), onSuccess: function(transport) { var notice = $(''searchresult''); notice.update(''Result (please drag & drop to table/seat) :''+transport.responseText); } }); }, searchResources:function() { var url ='' http://localhost/eventManager/index.php/welcome/searchResources/''; new Ajax.Request(url, { method: ''get'', onSuccess: function(transport) { var notice = $(''seat2''); notice.update(transport.responseText); } }); } } I try to find out comma , etc,... but I can not see it. Anyone see the problems? Thanks YUAN On Mon, May 19, 2008 at 6:33 PM, Rudy Susanto <rudy.ub-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Yes, responseText will automatically evaluated by Prototype. > > If you just want to display HTML fragment and execute script later, your > code should look like this: > > $(container).update(responseText.stripScripts()); > responseText.extractScripts().each(function(script){ > if (window.execScript) window.execScript(script); // MSIE > else window.eval(script); // > Mozilla Firefox > }); > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Rudy Susanto
2008-May-19 12:22 UTC
Re: Ajax.request , Automatic JavaScript response evaluation
I couldn''t found any error in your script on both FF2 and IE7. Maybe it come from response you get by Ajax.Request. NB: Private message aja mas di rudy_ub-/E1597aS9LQAvxtiuMwx3w@public.gmane.org, mungkin bisa share ^^ yuan yudistira wrote:> Hi Rudy, > > Thanks for the reply. > > Pardon me if my question is not very clear. > > My problem is that it seems that the script is not automatically > evaluated by prototype in IE7. > (the sortable element can be drag and drop) > > Now I get another clue after installing IEWebDeveloper v2, > I get error message : > > /_*Expected identifier, string or number*_/ > > > and here is a piece of js code i have : > > var coreAppObj = { > autoSearch:function() { > var url > =''http://localhost/eventManager/index.php/welcome/searchGuest/''; > new Ajax.Request(url, { > method: ''post'', > evalJS: ''true'', > postBody: ''searchguestname=''+$F(''searchguestname''), > onSuccess: function(transport) { > var notice = $(''searchresult''); > notice.update(''Result (please drag & drop to > table/seat) :''+transport.responseText); > } > }); > }, > searchResources:function() { > var url > =''http://localhost/eventManager/index.php/welcome/searchResources/''; > new Ajax.Request(url, { > method: ''get'', > onSuccess: function(transport) { > var notice = $(''seat2''); > > notice.update(transport.responseText); > } > }); > } > } > > > I try to find out comma , etc,... but I can not see it. > > Anyone see the problems? > > Thanks > > YUAN > > > On Mon, May 19, 2008 at 6:33 PM, Rudy Susanto <rudy.ub-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org > <mailto:rudy.ub-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>> wrote: > > Yes, responseText will automatically evaluated by Prototype. > > If you just want to display HTML fragment and execute script > later, your code should look like this: > > $(container).update(responseText.stripScripts()); > responseText.extractScripts().each(function(script){ > if (window.execScript) window.execScript(script); // MSIE > else > window.eval(script); // > Mozilla Firefox > }); >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Matt Foster
2008-May-19 14:54 UTC
Re: Ajax.request , Automatic JavaScript response evaluation
The error probably lies within the code in the response, post that and maybe we can discover the solution. -- Matt Foster Ajax Engineer Nth Penguin, LLC http://www.nthpenguin.com On May 19, 8:22 am, Rudy Susanto <rudy...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I couldn''t found any error in your script on both FF2 and IE7. Maybe it > come from response you get by Ajax.Request. > > NB: Private message aja mas di rudy...-/E1597aS9LQAvxtiuMwx3w@public.gmane.org, mungkin bisa share ^^ > > yuan yudistira wrote: > > Hi Rudy, > > > Thanks for the reply. > > > Pardon me if my question is not very clear. > > > My problem is that it seems that the script is not automatically > > evaluated by prototype in IE7. > > (the sortable element can be drag and drop) > > > Now I get another clue after installing IEWebDeveloper v2, > > I get error message : > > > /_*Expected identifier, string or number*_/ > > > and here is a piece of js code i have : > > > var coreAppObj = { > > autoSearch:function() { > > var url > > =''http://localhost/eventManager/index.php/welcome/searchGuest/''; > > new Ajax.Request(url, { > > method: ''post'', > > evalJS: ''true'', > > postBody: ''searchguestname=''+$F(''searchguestname''), > > onSuccess: function(transport) { > > var notice = $(''searchresult''); > > notice.update(''Result (please drag & drop to > > table/seat) :''+transport.responseText); > > } > > }); > > }, > > searchResources:function() { > > var url > > =''http://localhost/eventManager/index.php/welcome/searchResources/''; > > new Ajax.Request(url, { > > method: ''get'', > > onSuccess: function(transport) { > > var notice = $(''seat2''); > > > notice.update(transport.responseText); > > } > > }); > > } > > } > > > I try to find out comma , etc,... but I can not see it. > > > Anyone see the problems? > > > Thanks > > > YUAN > > > On Mon, May 19, 2008 at 6:33 PM, Rudy Susanto <rudy...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org > > <mailto:rudy...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>> wrote: > > > Yes, responseText will automatically evaluated by Prototype. > > > If you just want to display HTML fragment and execute script > > later, your code should look like this: > > > $(container).update(responseText.stripScripts()); > > responseText.extractScripts().each(function(script){ > > if (window.execScript) window.execScript(script); // MSIE > > else > > window.eval(script); // > > Mozilla Firefox > > });--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Yuan Yudistira
2008-May-20 15:23 UTC
Re: Ajax.request , Automatic JavaScript response evaluation
Hi Mat and Rudy Thanks for your reply. Sorry, I am away from my laptop for a while. You are right, the error comes from the code in the response. I found an additional comma. After I remove the comma, The ''guest'' sortable list now can be drag and drop into ''seat'' list as expected. Thank you! YUAN On Mon, May 19, 2008 at 9:54 PM, Matt Foster <mattfoster01-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > The error probably lies within the code in the response, post that and > maybe we can discover the solution. > > > -- > Matt Foster > Ajax Engineer > Nth Penguin, LLC > http://www.nthpenguin.com > > > > On May 19, 8:22 am, Rudy Susanto <rudy...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > I couldn''t found any error in your script on both FF2 and IE7. Maybe it > > come from response you get by Ajax.Request. > > > > NB: Private message aja mas di rudy...-/E1597aS9LQAvxtiuMwx3w@public.gmane.org, mungkin bisa share ^^ > > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---