On 27/09/2007, Hugo <[EMAIL PROTECTED]> wrote:
>
> I am writing a web application. There is a main page which loads the
> MochiKit library and my own JavaScript library. In order to avoid this
> very weighty loading (few seconds) every time I change of page, I'm
> using an iFrame which can access to the already loaded javascript
> methods and variables tanks to parent.any_function() or
> parent.any_variable. But, to stay transparent and lighter, I would
> prefer access the functions like in the main page => any_function() or
> any_variable.
>
> Has anyone an idea to avoid long manipulations like var any_variable1
> = parent.any_variable1 ; any_variable2 = parent.any_variable2...
> because I have a lot of functions and variables !


You can iterate through all the properties of an object using the for ... in
syntax. but I wonder, is this really necessary? Loading the code itself
shouldn't be a problem - that's what caching is for. What's left is
compilation (and whatever initialization you're doing). If your
initialization is fixed, you could probably do it on the server and download
it as JSON.

-- 
Tom Berger
http://intellectronica.net/

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"MochiKit" 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/mochikit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to