Re: [Proto-Scripty] $ function and IE
The easiest way around this is to write your code so it fails gracefully. Either one of these will work: $$('#noSuchElement').invoke(yourFunction); or var elm = $('noSuchElement'); if (elm) yourFunction(); The first one is my favorite, because it swallows any errors. If you're saying that you're getting an error from IE just from trying to use $('noSuchElement') all by itself, not actually trying to use the return from that, then the first method is what I would advise. Walter On Aug 30, 2011, at 3:06 PM, Shane McCarron wrote: I am sure this is a FAQ... but in IE prototype (version 1.7) throws an error when there is a reference to an ID that is not on the page (e.g., $('noSuchElement)). Is there some trick or idiom to work around this? -- Shane McCarron halindr...@gmail.com -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com . To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en . -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
Re: [Proto-Scripty] $ function and IE
That's very clever. Mostly I am surprised that only IE pukes on what I assume to be a very common problem... Anyway, thanks! On Tue, Aug 30, 2011 at 3:01 PM, Walter Lee Davis wa...@wdstudio.comwrote: The easiest way around this is to write your code so it fails gracefully. Either one of these will work: $$('#noSuchElement').invoke(**yourFunction); or var elm = $('noSuchElement'); if (elm) yourFunction(); The first one is my favorite, because it swallows any errors. If you're saying that you're getting an error from IE just from trying to use $('noSuchElement') all by itself, not actually trying to use the return from that, then the first method is what I would advise. Walter On Aug 30, 2011, at 3:06 PM, Shane McCarron wrote: I am sure this is a FAQ... but in IE prototype (version 1.7) throws an error when there is a reference to an ID that is not on the page (e.g., $('noSuchElement)). Is there some trick or idiom to work around this? -- Shane McCarron halindr...@gmail.com -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@** googlegroups.com prototype-scriptaculous@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+** unsubscr...@googlegroups.comprototype-scriptaculous%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/** group/prototype-scriptaculous?**hl=enhttp://groups.google.com/group/prototype-scriptaculous?hl=en . -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@** googlegroups.com prototype-scriptaculous@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+** unsubscr...@googlegroups.comprototype-scriptaculous%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/** group/prototype-scriptaculous?**hl=enhttp://groups.google.com/group/prototype-scriptaculous?hl=en . -- Shane McCarron halindr...@gmail.com -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
Re: [Proto-Scripty] $ function and IE
Actually, I lied. They ALL puke. Duh. It is just that IE is more obvious about it. I guess everyone else already knew this. I am slow ;-) On Tue, Aug 30, 2011 at 3:19 PM, Shane McCarron halindr...@gmail.comwrote: That's very clever. Mostly I am surprised that only IE pukes on what I assume to be a very common problem... Anyway, thanks! On Tue, Aug 30, 2011 at 3:01 PM, Walter Lee Davis wa...@wdstudio.comwrote: The easiest way around this is to write your code so it fails gracefully. Either one of these will work: $$('#noSuchElement').invoke(**yourFunction); or var elm = $('noSuchElement'); if (elm) yourFunction(); The first one is my favorite, because it swallows any errors. If you're saying that you're getting an error from IE just from trying to use $('noSuchElement') all by itself, not actually trying to use the return from that, then the first method is what I would advise. Walter On Aug 30, 2011, at 3:06 PM, Shane McCarron wrote: I am sure this is a FAQ... but in IE prototype (version 1.7) throws an error when there is a reference to an ID that is not on the page (e.g., $('noSuchElement)). Is there some trick or idiom to work around this? -- Shane McCarron halindr...@gmail.com -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@** googlegroups.com prototype-scriptaculous@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+** unsubscr...@googlegroups.comprototype-scriptaculous%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/** group/prototype-scriptaculous?**hl=enhttp://groups.google.com/group/prototype-scriptaculous?hl=en . -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@** googlegroups.com prototype-scriptaculous@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+** unsubscr...@googlegroups.comprototype-scriptaculous%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/** group/prototype-scriptaculous?**hl=enhttp://groups.google.com/group/prototype-scriptaculous?hl=en . -- Shane McCarron halindr...@gmail.com -- Shane McCarron halindr...@gmail.com -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
Re: [Proto-Scripty] $ function and IE
You're welcome. I gave up being surprised what IE does somewhere back in 1998. Walter On Aug 30, 2011, at 4:19 PM, Shane McCarron wrote: That's very clever. Mostly I am surprised that only IE pukes on what I assume to be a very common problem... Anyway, thanks! On Tue, Aug 30, 2011 at 3:01 PM, Walter Lee Davis wa...@wdstudio.com wrote: The easiest way around this is to write your code so it fails gracefully. Either one of these will work: $$('#noSuchElement').invoke(yourFunction); or var elm = $('noSuchElement'); if (elm) yourFunction(); The first one is my favorite, because it swallows any errors. If you're saying that you're getting an error from IE just from trying to use $('noSuchElement') all by itself, not actually trying to use the return from that, then the first method is what I would advise. Walter On Aug 30, 2011, at 3:06 PM, Shane McCarron wrote: I am sure this is a FAQ... but in IE prototype (version 1.7) throws an error when there is a reference to an ID that is not on the page (e.g., $('noSuchElement)). Is there some trick or idiom to work around this? -- Shane McCarron halindr...@gmail.com -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com . To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en . -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com . To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en . -- Shane McCarron halindr...@gmail.com -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com . To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en . -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com. To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.