Hi Guys

As i'm sure you're aware, when you create an element in Internet Explorer,
document.createElement doesn't extend the element that you create whereas
firefox+others do.
This has recently just come up again in rails-spinoffs.

While I was researching the problem, I found this page where the author Paul
Sowden suggested a fix where the original createElement method is copied to
another name and replaced.

While his example (from 2004) isn't relevant to the prototype library as he
adds his own methods in with a for-in, I thought it would be a good idea to
attempt a fix for prototype.

I understand this should be added as a patch in trac but I am not actually
sure where it belongs.

The relevant code is 2 lines, and i've attached a simple test page which
i've checked in (only) IE7 and FF 1.5.0.11

The 2 lines are:

  document._createElement = document.createElement;
  document.createElement = function(tag) { return
$(document._createElement(tag)); }

Let me know what you think. I am not honestly sure how to go about creating
a unit test/official patch, as I believe many others aren't.
Just haven't had the time to research it.

Gareth

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype: Core" group.
To post to this group, send email to prototype-core@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-core?hl=en
-~----------~----~----~----~------~----~------~--~---





Output:

Reply via email to