You could use $.getScript() and then use the callback function in it.
It is supposed that .ready() waits for all the getScript to load, before it
fires itself, but I can't make it happen yet, so I'm using the callback.
On 9/13/07, bigbird023 <[EMAIL PROTECTED]> wrote:
>
>
> I have a question since some plugins are relying on other plugins for
> functionality.
>
> My Question might have already been solved, but i don't see it in the
> documentation.
>
> I basically would like to create a js file that has all my commonly
> used jQuery stuff in it, therefore, needing a way to import plugins
> into the DOM before the "ready" event fires.
>
> I am requesting a function, for example "importJS", will load the
> javascript file into the head of the document, and force the ready
> event to wait until these additional files are loaded.
>
>
>
> Example JS file
> /* INCLUDE JQUERY REQUIREMENTS FOR BASEINTERFACE.JS */
> $importJS('/js/jQuery/plugins/calendar/jquery-calendar.js');
> $importJS('/js/jQuery/plugins/validationAide/stringaide.js');
> $importJS('/js/jQuery/plugins/validationAide/validationAide.js');
>
> $(document).ready(function(){
>
> /* DEFINE CALENDAR FIELDS */
> $(".fieldControlDate").calendar({autoPopUp: 'button',
> buttonImageOnly: true, buttonImage: '/images/calendar_mini.gif',
> buttonText: 'Calendar', dateFormat: 'MDY/'});
>
> /* DEFINE FORM VALIDATION */
> $("form").validationAideEnable(
> null,
> {showInlineMessages:true, showSummary:false,
> inlineMessageCssClass:"fieldvaluerequired-message",
> fieldErrorCssClass:"fieldvaluerequired"},
> function (fieldValue, fieldObj){
> $
>
> ("#"+fieldObj.id).parents(".fieldcontainer").removeClass("fieldcontainerrequired");
> },
> function (fieldValue, fieldObj, success){
> if (!success) {
> $
>
> ("#"+fieldObj.id).parents(".fieldcontainer").addClass("fieldcontainerrequired");
> }
> }
> );
>
> });
>
>
> thoughts????
> thanks.......
>
>
--
Joan Piedra || Frontend web developer
http://www.justaquit.com/ || http://www.joanpiedra.com/