[Dojo-interest] Re: ContentPane executing scrpts
Bill Keese
bill at dojotoolkit.org
Thu Apr 20 22:46:06 MDT 2006
The original goal was that 2 contentpanes can include the same content
(ie, include the same href) and they won't interfere with each other. I
don't think your suggestion handles that case, in particular, the call
from an onclick handler
<div onclick="???">
Also, note that there isn't a predefined namespace per say; rather, each
ContentPane gets it's own generated namespace. The "execScope" thing is
just a trigger to tell ContentPane to use that generated namespace.
Bill
Tom Trenka wrote:
> While it sounds cool, I would throw out the opinion that having a pre-defined namespace for things loaded via ContentContainer (it's ContentContainer now, right?) is a bad idea; it encourages laziness on the part of the developer of the code and it uses so called "magic" words that require all sorts of maintenance and docs and what not.
>
> I've been very successful using the JS version of "block scope" in conjunction with simply dropping the "var' keyword off of variables I'm looking to park in the global object:
>
> (in included content:)
>
> <script type="text/javascript">
> function(){
> // do stuff here
> myOutsideAccessibleThing={};
> }();
> </script>
>
> ...at which point myOutsideAccesibleThing is parked in the global object, local varables don't clobber anything else, and closures can be used to deal with other issues. There will be memory issues if closures aren't handled properly but so far this is the cleanest solution I can think of, and it doesn't require adding anything to the Dojo library to handle special needs (aka bloat :))
>
> trt
> ---------------------------------------------------------------------
> Posted via Jive Forums
> http://forums.opensymphony.com/thread.jspa?threadID=25608&messageID=52665#52665
>
> _______________________________________________
> Dojo FAQ: http://dojo.jot.com/FAQ
> Dojo-interest at dojotoolkit.org
> http://dojotoolkit.org/mailman/listinfo/dojo-interest
More information about the Dojo-interest
mailing list