[dojo-contributors] self executing scripts

Peter E Higgins dante at dojotoolkit.org
Sun May 31 11:00:03 EDT 2009


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



More information about the dojo-contributors mailing list