Tobie and I looked at this, wrote a few reduced test cases, and
reluctantly concluded that we're fucked here.
If you tell IE to give you the generated source of your test page
(i.e. document.body.innerHTML), it'll return its own "normalized"
version of your markup. One of the things it does when normalizing is
to expand all relative URLs to their fully-resolved equivalents. This
ordinarily isn't a problem, since you can get at the initial value
with "someElement.getAttribute('href' 2);". Tobie's "attribute
nightmare" blog post linked to in my previous message goes into this
in detail.
When you *set* innerHTML, though, IE normalizes your markup string
*before* it appends that markup to the DOM. So in this case, using
"someElement.getAttribute('href', 2)" will return the normalized &
resolved URL, since the DOM has never seen whatever you originally set
that HREF to.
This is just one more example of how the Document Object Model is
attached to IE6 with duct tape.
One workaround is to be aware of this gotcha and to craft your CSS
selectors accordingly (i.e., using "$=" instead of "=" like I advised
in my last message). Another is to use the DOM element creation
methods instead of innerHTML wherever possible -- but that doesn't
help you at all with Ajax.Updater or Element#update.
We're planning to add DOM node support to Element#update (so that it
can take either a string or an existing DOM node) in the 1.5.2 release
of Prototype. That should make things a bit easier.
Cheers,
Andrew
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---