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

LabKey Support Forum (Inactive)
Using JQuery in a Module... Path Issue... Ben Bimber  2016-04-26 12:40
Status: Closed
 
FWIW, you can probably declare your dependency directly on that URL, instead of copying the JS file and distributing it w/ your module:

<dependency path="https://code.jquery.com/jquery-2.2.3.min.js"></dependency>

though i havent done that in a while.

if declaring dependencies explictly in the XML, you dont need to use LABKEY.requiresScript.

If you do want to distribute that JS file w/ your module, the path you provide is relative to the web root, not the module's root. so if you put the file in: "../externalModules/helloworld/js/jquery-2.2.2.min.js", this probably wont work. I think Nick was suggesting you place it somewhere like:

../externalModules/helloworld/web/jquery-2.2.2.min.js

in which case you'd just use the path relative to /web:

<dependency path="jquery-2.2.2.min.js"></dependency>

you could use a subfolder named after your module, which I'd argue is better practice - so modules dont clash:

../externalModules/helloworld/web/helloworld/jquery-2.2.2.min.js

which should mean:

<dependency path="helloworld/jquery-2.2.2.min.js"></dependency>