Jörn,

>// Implementation:
>$.require = function(names) {
>       $.each(names.split(","), function(i, n) {
>               if( !$.fn[n] || $[n] )
>                       throw "required plugin " + n + " not found";
>       });
>}
>// Usage:
>$.require("autocomplete,dimensions");

I was thinking of using an array instead of splitting a string. The reason
is, I could see eventually being able to define more information about a
plugin, such as a version number.

/*
        Require:
                Autocomplete v1.2
                Dimensions (any version)
*/
$.require([["autocomplete, 1.2], "dimensions"];

Or something like that...

-Dan

Reply via email to