rbaisak.nyc-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2007-Mar-20 02:23 UTC
Continuous Ajax.Request generates exception
Hi Group, In my javascript, I am using consecutive Ajax.Request. First Ajax.Request works perfectly but in case of second Ajax.Request method call, it generates exception and it goes to onException: block. I am not sure why such exception occurs. Any input on how to get rid of such exception... - R --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
What is the exception being fired? onException is an assignable callback that accepts two arguments, the first being the actual Ajax.Request object and the second being the exception that was thrown. Alert that exception and let us know what it is and maybe we''ll be able to better solve your problem. Example: new Ajax.Request(''index.html'',{ method: ''get'', onException: function(req,exception) { alert(exception); } }); -E On 3/19/07, rbaisak.nyc-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org <rbaisak.nyc-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > Hi Group, > In my javascript, I am using consecutive Ajax.Request. > First Ajax.Request works perfectly but in case of second Ajax.Request > method call, it generates exception and it goes to onException: block. > I am not sure why such exception occurs. Any input on how to get rid > of such exception... > > - R > > > > >-- Eric Ryan Harrison --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
I am getting following exception "Reference Error: Processor not defined" I have attached following scripts that generates exception. var URL; try { alert(new XMLSerializer().serializeToString(uriDoc)); var objNodeList = uriDoc.selectNodes(sXpath); URL = ''http://localhost:8080/AT/ParserServlet?action=feed''; for(i=0;i<objNodeList.length;i++) { var uriNode = objNodeList[i]; URL = URL + ''&uri''+i+''=''+uriNode.firstChild.nodeValue; } }catch(exception) { alert("Error occurred while loading stylesheet, :"+exception); } alert(URL); //Sends request new Ajax.Request(URL, { method: ''get'', onComplete: showConsole, onException: function(req,exception){ alert("Exception while showin feeds :"+exception);//Here it generates exception. }, onError: function(req,exception){ alert("Error while showin feeds :"+exception); } }); On 3/20/07, Eric Harrison <blister-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > What is the exception being fired? onException is an assignable > callback that accepts two arguments, the first being the actual > Ajax.Request object and the second being the exception that was > thrown. Alert that exception and let us know what it is and maybe > we''ll be able to better solve your problem. > > Example: > > new Ajax.Request(''index.html'',{ > method: ''get'', > onException: function(req,exception) { alert(exception); } > }); > > -E > > On 3/19/07, rbaisak.nyc-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org <rbaisak.nyc-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > Hi Group, > > In my javascript, I am using consecutive Ajax.Request. > > First Ajax.Request works perfectly but in case of second Ajax.Request > > method call, it generates exception and it goes to onException: block. > > I am not sure why such exception occurs. Any input on how to get rid > > of such exception... > > > > - R > > > > > > > > > > > > -- > Eric Ryan Harrison > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Christophe Porteneuve
2007-Mar-21 07:25 UTC
Re: Continuous Ajax.Request generates exception
Ranjan Baisak a écrit :> I am getting following exception > > "Reference Error: Processor not defined" > I have attached following scripts that generates exception.Not Prototype-related. The XML/JS library you appear to use must be missing one or more files (that you don''t load with your <script> tags). -- Christophe Porteneuve a.k.a. TDD "[They] did not know it was impossible, so they did it." --Mark Twain Email: tdd-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org --~--~---------~--~----~------------~-------~--~----~ 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 Ranjan, The XMLSerializer looks non-standard. Mozilla supports one out of the box, .NET for Ajax/Atlas has one (I think, not 100% sure about this one), and Sarissa provides a cross-browser one based on the Mozilla one. Which are you using (or is it something else that I haven''t come across)? A common issue when working with XML and prototype is that the Ajax classes in IE will return a version 2 MSXML ActiveX component (see line 757 of Prototype 1.5.0), even if version 3 or 4 are installed. If some other library is picking up or creating XML docs of a different version, they don''t often play well together, and cryptic errors get generated, although this doesn''t look like one I''ve seen before. You''re using XPath to selectNodes() - that''s only supported in MSXML 3.0 up, if I remember right. These are slightly wild guesses - tell us which browser you''re seeing the problems on, and I might be able to figure out a bit more. HTH Dave ---------------------- Author Ajax in Action http://manning.com/crane Ajax in Practice http://manning.com/crane2 Prototype & Scriptaculous in Action http://manning.com/crane3 On Wednesday 21 March 2007 02:11, Ranjan Baisak wrote:> I am getting following exception > > "Reference Error: Processor not defined" > I have attached following scripts that generates exception. > > var URL; > > try > > { > > alert(new XMLSerializer().serializeToString(uriDoc)); > > var objNodeList = uriDoc.selectNodes(sXpath); > > URL = ''http://localhost:8080/AT/ParserServlet?action=feed''; > > for(i=0;i<objNodeList.length;i++) > > { > > var uriNode = objNodeList[i]; > > URL = URL + ''&uri''+i+''=''+uriNode.firstChild.nodeValue; > > } > > }catch(exception) > > { > > alert("Error occurred while loading stylesheet, :"+exception); > > } > > alert(URL); > > //Sends request > > new Ajax.Request(URL, { > > method: ''get'', > > onComplete: showConsole, > > onException: function(req,exception){ > > alert("Exception while showin feeds :"+exception);//Here it generates > exception. > > }, > > onError: function(req,exception){ > > alert("Error while showin feeds :"+exception); > > } > > }); > > On 3/20/07, Eric Harrison <blister-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > What is the exception being fired? onException is an assignable > > callback that accepts two arguments, the first being the actual > > Ajax.Request object and the second being the exception that was > > thrown. Alert that exception and let us know what it is and maybe > > we''ll be able to better solve your problem. > > > > Example: > > > > new Ajax.Request(''index.html'',{ > > method: ''get'', > > onException: function(req,exception) { alert(exception); } > > }); > > > > -E > > > > On 3/19/07, rbaisak.nyc-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org <rbaisak.nyc-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > Hi Group, > > > In my javascript, I am using consecutive Ajax.Request. > > > First Ajax.Request works perfectly but in case of second Ajax.Request > > > method call, it generates exception and it goes to onException: block. > > > I am not sure why such exception occurs. Any input on how to get rid > > > of such exception... > > > > > > - R > > > > -- > > Eric Ryan Harrison > > > > > > -- > This email has been verified as Virus free > Virus Protection and more available at http://www.plus.net-- --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---