Hello, is there a way to suppress rjs error messages, because i am trying to check if some variable is present, with (variable == undefined), but rjs stops processing and throws out error, because there is >>reference error<<. Whatever, this is javascript, you cannot have reference error in javascript.... BTW: i know i could just create a javascript file, and assign undefined values to variables, but that would kinda suck. Thanks for any suggestions. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
Aleksander Pejčić wrote:> Hello, > > is there a way to suppress rjs error messages, because i am trying to > check > if some variable is present, with (variable == undefined), but rjs stops > processing and throws out error, because there is >>reference error<<. > Whatever, this is javascript, you cannot have reference error in > javascript.... >This isn''t rjs stopping processing, it''s your browser throwing the exception while evaluating the javascript (which just happens to be created via rjs). see http://www.irt.org/script/778.htm for testing for the presence of a variable. Fred -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
apejcic-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2006-Sep-20 17:16 UTC
Re: RJS & ReferenceError
You must be mistaken... i have this code: if(timer == undefined) timer = setTimeout(\"effect = new fx.Opacity($(''login_message''), {duration: 2000, onComplete: function() { timer undefined;}}).toggle();\", 2000); You can probably see what i am trying to accomplish. And it work if i use it like a regular javascript, which means putting it in external .js file or "inlineing" it html file, but when i use this inside rjs file with page << ".." directive, i get rjs warnig about reference error. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
some more fun: page << " alert(typeof timer); ", messaged that timer is undefined, and right after i pressed ok, a new alert popped up whining about rjs reference error --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
Update: (typeof timer == ''undefined'') worked --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---