Re: Sharing javascript between iframes

Seth Dillingham
Mon, 24 Jul 2006 13:45:21 -0000

On 7/24/06, Mike Rumble
<mike.rumble-nJYiJFE0GtnQXOPxS62xeg@public.gmane.org> wrote:

> The alternative would be to load prototype in the document content of
> the iframe, thus meaning multiple instances of prototype would be in
> existence. Is this such a bad thing, would it lead to a performance hit?

This is exactly what I''ve done. As long as you''re loading
prototype
from the same URL for both the parent window and the iframe, the
second one should be loaded from cache (though of course that depends
on your server sending the right headers), so there''s very little
overhead in that regard.

I''ve done this in two significant projects, and I didn''t
encounter any
significant performance issues once everything was loaded.

Seth