Pointy5,

I've run across the issue similar to it. I ruled it out with the
notion of the following:
When you call functions accross windows, the call chain tracks you
back to the original window (windows have separate JS engines). So
even if you're searching for element in window "A" having started from
window "B", the code of $() function will do the seeking in the "B"
window. In order to break the call chain, you (I did it) have to set a
timeout on window "A" (having started from "B" window) with minimal
time (0 or 1) to call a function local to "A" to do the rest. This
breaks the chain, 'window' object hereafter will refer to window "A",
not "B". To make the call safe.

With best regards,

Andrew



On Aug 5, 10:03 pm, pointym5 <[EMAIL PROTECTED]> wrote:
> On Aug 2, 8:07 am, Christophe Porteneuve <[EMAIL PROTECTED]> wrote:
>
> > Hey,
>
> > I can't believe this thread is so long...  There's just no way we won't
> > extend prototypes on elements, I think.  It's at the core of what we do.
>
> Yes, there definitely is a way, in Firefox:
>
> 1) Create a page with an iframe. The page should import prototype.js.
> 2) Create a page to be loaded in the iframe. That page should *not*
> import prototype.js.
> 3) Have the iframe page call
> "parent.something(document.getElementById('x'))", such that the parent
> "something" function calls $(arg) on its argument and then expects the
> object to have all the Prototype element extensions.
> 4) Boom.
>
> "That's silly", you may say, "just import prototype in your iframe
> page."  That is indeed the best approach to take, but it's a non-
> trivial issue in an extensive application with hundreds of pages that
> all use services on the "top" page.  The "top" code cannot expect
> using $() to extend correctly incoming (as parameters) elements until
> all pages have been changed to import Prototype.


--~--~---------~--~----~------------~-------~--~----~
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 [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to