Using JQuery in a Module... Path Issue...

LabKey Support Forum (Inactive)
Using JQuery in a Module... Path Issue... diego  2016-04-26 12:17
Status: Closed
 
Nick,

So once I have declared the dependencies in "helloWorld.view.xml"

<view xmlns="http://labkey.org/data/xml/view" title="Hello World View">
    <dependency path="../externalModules/helloworld/js/jquery-2.2.2.min.js"/>
    <dependency path="../externalModules/helloworld/js/jquery-ui-1.11.4.custom/jquery-ui.js"/>
</view>

Do I still need to declare jQuery in the Javascript below? "LABKEY.requiresScript([ .... ]);

Thanks,
Diego

############# JAVASCRIPT BELOW ###############

<script type="text/javascript">

    var jQueryReady = function() {

        /* Use JQuery */
        $('a.usejquery').click(function(event){
            alert('JQuery allowed this to happen.');
        });
           
    }

    /* Request the scripts -- you do not need to provide the Context Path */
   LABKEY.requiresScript([
        'https://code.jquery.com/jquery-2.2.3.min.js',
        'https://code.jquery.com/ui/1.11.4/jquery-ui.js'
        // add more files to this array
    ], true, jQueryReady, this, true);

</script>