1st, if you don't already have it running, install
firefox with the Javascript debugger (need to use the
'custom install' feature).  You'll then be able to see
exactly how the dom tree is layed out on each page
(text + div + other elements, etc)

>From what you've written it looks like you're getting
a text element instead of the div you desire.  That's
probably the correct behavior, since any text will
generate a text element. 

So instead of trying to use some sort of
relative/proximity access scheme, I'd suggest an
alternate more explicit approach.  Perhaps naming your
'divs' with a numbering scheme if you're generating
them dynamically (e.g. 'item_21', 'item_22', etc.) as
well as your images (<img id='img_21' ...)

Then you can just parse off the number (indexOf +
substr) and lookup the associated 'item'/div
explicitly with getElementById('item_' + idnumber).

Not sure if that will fit your situation.

Cheers,

-San


--- "Marco M. Jaeger" <[EMAIL PROTECTED]> wrote:

> 
> Hello,
> 
> I was wondering whether somebody can give me a
> little hand on this:
> 
> I have the following code: "var img = 
>
this.el.previousSibling.getElementsByTagName('IMG')[0];"
> 
> While IE correctly returns the image object, Firefox
> returns an error. What 
> I discovered so far is that this.el.previousSibling
> returns the DIV tag an 
> IE which is correct - however, Firefox returns this:
> #text.
> 
> I was wondering whether there is some use of the
> prototype cleanWhitespace 
> but I couldn't make this to work yet.
> 
> Does anybody see a workaround/.
> 
> Thank you in advance for your help.
> 
>
_________________________________________________________________
> Express yourself instantly with MSN Messenger!
> Download today - it's FREE! 
>
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
> 
> _______________________________________________
> Rails-spinoffs mailing list
> [email protected]
>
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
> 



        
                
__________________________________ 
Yahoo! Mail - PC Magazine Editors' Choice 2005 
http://mail.yahoo.com
_______________________________________________
Rails-spinoffs mailing list
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs

Reply via email to