Well, in the catch it''s looking for a tbody or tr, so I''m
guessing that
trying to insertAdjacentHTML to a tbody or tr fails in IE and Opera.
Maybe it''s only certain versions.
Greg
> -----Original Message-----
> From:
rails-spinoffs-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
[mailto:rails-spinoffs-> bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org] On Behalf Of
Peter Michaux
> Sent: Friday, July 21, 2006 8:54 AM
> To: rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
> Subject: [Rails-spinoffs] Abstract insertion question
>
> Hi,
>
> In the following block of Prototype.js when will the catch() block
> run? I cannot create conditions in Opera where it will run.
>
> Thanks,
> Peter
>
> if (this.element.insertAdjacentHTML) {
> /* IE and Opera */
> try {
> this.element.insertAdjacentHTML(this.adjacency, this.content);
> } catch (e) {
> // when will this run? can feature detection be used instead?
> var tagName = this.element.tagName.toLowerCase();
> if (tagName === ''tbody'' || tagName ===
''tr'') {
> this.insertContent(this.contentFromAnonymousTable());
> } else {
> throw e;
> }
> }
> }
> _______________________________________________
> Rails-spinoffs mailing list
> Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
> http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs