I''ve seen similar problems with Mozilla browsers adding nodes for
whitespace (in my case, in between TR elements). I consider it a bug;
they may not. At the very least, it''s extremely obnoxious because you
expect only the elements actually on the page to be in the DOM. Anyway,
you pretty much can''t rely on lastChild, previousSibling, or
nextSibling
in mozilla browsers, from my experience. There might be some trick to it
that I can''t figure out. I''d suggest doing something like:
var el = $(''commentList'').lastChild;
while (el.tagName != ''LI'') {
el = el.previousSibling;
}
new Effect.BlindDown(el);
This might work as well:
new
Effect.BlindDown($(''commentList'').getElementsByTagName(''LI'').pop());
but I''m not sure you can do getElementsByTagName() on an OL. If you
can, that is much easier to read, IMO.
Good luck.
Greg
-----Original Message-----
From: rails-spinoffs-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
[mailto:rails-spinoffs-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org]
On Behalf Of
kellan
Sent: Thursday, November 10, 2005 3:33 PM
To: rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
Subject: [Rails-spinoffs] Effect.BlindDown: element.style has no
properties
I''m running Typo, and after a comment is successfully posted, Typo
runs this snippet of Javascript:
new Effect.BlindDown($(''commentList'').lastChild);
which throws the following error under Firefox 1.5rc1 (OSX)
Error: element.style has no properties
Source File: http://laughingmeme.org/javascripts/effects.js
Line: 754
The problem being that lastChild() is returning the whitespace between
the final </li> and the closing </ol>
I know this isn''t specifically a problem with prototype/scriptaculous,
but I wasn''t sure where else to ask if this behaviour is a Firefox bug
that should be filed, or is behaving as expected. (and if expected
how do I solve it? I''ve tried removing all the whitespace but render
:partial seems to inserting a newline at some point)
Thanks
-kellan
ps. blog in question is at: http://laughingmeme.org
_______________________________________________
Rails-spinoffs mailing list
Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs