Marco and I have been emailing about this and I finally found the fix, so here it is.  Feel free to pass it along to Sam, if he even responds to bug reports any more:

In prototype.js, change line 998 From:

        Element.remove(node);

 

To:

        node.parentNode.removeChild(node);

 

Element.remove calls $(), which calls Element.extend.  In Element.extend, when it says element._extended = true;, it dies in IE on text nodes (element.nodeType == 3).  Since we don’t really care to extend the node just to remove it, we should not even care about appending all of the extra functions to the node.  Another option is to put a conditional in $() that just returns the element if it has a nodeType of 3, but I suppose there might be some weird case where you actually want to add extra functions to text nodes (I can’t think of any at the moment, though).

 

Greg

 


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Gregory Hill
Sent: Wednesday, May 24, 2006 8:28 AM
To: [EMAIL PROTECTED]; [email protected]
Subject: RE: [Rails-spinoffs] enumerables problem?

 

I think the problem is the .bind(this).  You aren’t referencing ‘this’ in the function, what are you binding?  I’d say drop it and see if it fixes it.

 

Greg

 


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Marco M. Jaeger
Sent: Wednesday, May 24, 2006 5:42 AM
To: [email protected]
Subject: [Rails-spinoffs] enumerables problem?

 

 

I was wondering whether anybody could please tell me why this is causing an error in IE (works in Firefox):

 

$A(container.getElementsByTagName('*')).each( function(el) {
    Element.cleanWhitespace(el); 
   }.bind(this));

 

What would be an alternative of achieving the same?

 

Thank you

 

Marco M. Jaeger | Url: http://mmjaeger.com | E-mail: [EMAIL PROTECTED]
Do you need business consulting, webdesign or webhosting: please visit http://j-cons.com or please contact me at [EMAIL PROTECTED].

 

_______________________________________________
Rails-spinoffs mailing list
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs

Reply via email to