Hi,

As some background, under Moz, Prototype adds to Element.prototype (I think 
this is correct, I haven't checked the source) the methods become available on 
every Element. On IE, Prototype can't extend Element.prototype so it wraps the 
element instead.

This gets more complicated when you are using an iframe (eg, in designmode for 
a wysiwyg editor). Now, if from the parent window you get an element from the 
child window and call $(element) you have an unextended element, even if the 
element were created in the parent frame. This is true in Moz, I'm not sure in 
IE (don't have a windows box handy right now) but I suspect in IE $(element) 
has the Prototype methods available because the wrapping would still work.

What seems to be happening is there is a window.Element and a separate 
otherwindow.Element and when you move an Element from one window to another 
the Element object's prototype chain gets modified to contain the other 
window's Element.

I'm thinking maybe it would be possible to do something like:

otherWindow.Ajax = Ajax;
otherWindow.Enumerable = Enumerable;
otherWindow.Element = Element;
otherWindow.$ = $;

Has anybody tried this? Is there an 'approved' way to load Prototype into a 
subframe?

The reason I don't just want to add a <script> to the iframe is my web 
application wraps all the code up into a single file (prototype, 
scriptaculous, my stuff) and I never thought the components would have to be 
loaded separately - seems a bit inefficient to distribute certain parts twice.

Thanks for any help,
Jim

-- 
Jim
my wiki ajaxification thing: http://wikizzle.org
my blog: http://jimhigson.blogspot.com/


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to