[dojo-contributors] self executing scripts

Mike Wilcox mwilcox at sitepen.com
Sun May 31 11:11:15 EDT 2009


I think it's great. I had tried formatting my code this way early on,  
and saw that it didn't work. I like that you have a "dojo block" of  
code.

It spawns a few other ideas:

Useful if you only had one or two "main" require scripts:
<script src="dojo.js" djConfig="parseOnLoad=true"
	require="my.application" />

May be slower to load (requiring two passes with the parser maybe) but  
I bet newbies would like it:
<script src="dojo.js" djConfig="parseOnLoad=true"
	autoRequire="true" />

Mike Wilcox
mwilcox at sitepen.com
http://www.sitepen.com
work: 650.968.8787 x218
cell:	  214.697.4872

On May 31, 2009, at 10:00 AM, Peter E Higgins wrote:

>
> Hi List,
>
> I don't normally cross post / blog, but I am quite curious to hear if
> anyone thinks this is a good idea for Dojo:
>
> http://higginsforpresident.net/2009/05/degrading-script-tags/
>
> The jist is: a syntax like this would work:
>
> <script src="dojo/dojo.js" djConig="parseOnLoad:true">
>    dojo.require("dijit.TitlePane");
>    dojo.require("dijit.layout.BorderContainer");
>    // or just:
>    dojo.require("my.application");
> </script>
>
> It is "kind of magic", but I like it [though am unsure if anyone else
> would find it handy]. If dojo.js is a 404, nothing at all will happen,
> failing silently but easily identifiable in firebug. The progressive
> JS case comes to mind.
>
> It requires a 3-line patch to base, which at the moment includes an
> #ifdef to remove the functionality by way of a build kwArg  
> 'noSelf=true'
>
> Regards,
> Peter
>
> -- 
> Peter E Higgins
> Dojo Project Lead : http://dojotoolkit.org
>
> _______________________________________________
> dojo-contributors mailing list
> dojo-contributors at mail.dojotoolkit.org
> http://mail.dojotoolkit.org/mailman/listinfo/dojo-contributors
>



More information about the dojo-contributors mailing list