After a long debugging-session I found out what was causing the error.
By differ the two versions of prototype (the one in script.aculo.us
1.6.4 and one in 1.6.5) I found out by my surprise that it was the
getElementsByClassName-method that was causing my error. And when I
changed the row "if (Element.hasClassName(child, className))" into "if
(child.className.match(new RegExp('(^|\\s)' + className + '(\\s|$)')))"
it suddenly started to work.

After a while I found out that it was because that the hasClassName
method expands all child elements and also put a _expanded="true"
attribute on the tag. And when I found out that I understod what the
problem was: I build up part of my HTML document by saving some inner
html from one block and paste into another later, and before all this I
run a getElementsByClassName clause which previously didn't expand the
html but now do, so when I paste the saved html into my new element it
now also contains the expanded-attribute which makes it virtually
expanded to the DOM even if it's not.... so now I have to do a
element.innerHTML.replace(/\s+_extended=\"true\"/gi, ''); before I save
down the inner html for later use and that solves my problem...
Maby not the nicest solution but it atleast works for now. If you have
any better solution do not hesitate to tell me ;)

So in the end maybe not a bug in prototype, but definitely a change in
behavior that caused me a lot of confusion but in the end thought me a
whole lot about prototype ;)


--~--~---------~--~----~------------~-------~--~----~
 You received this message because you are subscribed to the Google Groups 
"Ruby on Rails: Spinoffs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to