Hi ! I was wondering if I were the only one to experience this issue
under IE7 ? I loaded an XML tree and I''m trying to the read the
attribute off the XML node, but IE fires an error right in the
Element.extend function (at the first line "element = $(element)" in
Element.readAttribute). (Removing the line doesn''t seem to cause any
effect in the code by the way.)
But if I manage to skip this error, it would still crash where "var
attribute = element.attributes[name];"
It seems that IE holds the XML attribute in an array (very much
inconsistent thank you MS !) So I had to add another check. Here''s the
function that succeeded preliminary tests :
Element.Methods = {
[...]
readAttribute: function(element, name) {
//element = $(element);
if (document.all && !window.opera) {
var t = Element._attributeTranslations;
if (t.values[name]) return t.values[name](element, name);
if (t.names[name]) name = t.names[name];
if ( element.attributes.length ) {
for (var i=0; i<element.attributes.length; i++) {
var attribute = element.attributes[i];
if ( attribute.name == name) return attribute.value;
}
} else {
var attribute = element.attributes[name];
return attribute ? attribute.nodeValue : null;
}
}
return element.getAttribute(name);
},
[...]
};
... Now I have to find why IE7 crashes when executing a portion of my
Javascript (works fine in FF).... stoopid IE.
-yanick
--~--~---------~--~----~------------~-------~--~----~
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
rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---