Step 1: Upload the jQuery library as a static resource in your Org.
Step 2: Use ltng:require
to load static resource JavaScript libraries on your component.
<aura:component> <ltng:require scripts="{!$Resource.YourStaticResourceName + '/jQueryFileName.js'}" /> </aura:component>
Step 3: To utilize the library include the afterScriptsLoaded
event and add the method in your aura component JS controller.
Aura Component :
<aura:component> <ltng:require scripts="{!$Resource.YourStaticResourceName + '/jQueryFileName.js'}" afterScriptsLoaded="{!c.handleAfterScriptsLoaded}" /> </aura:component>
JS Controller:
({ handleAfterScriptsLoaded : function(component, event, helper) { jQuery("document").ready(function(){ console.log('jQuery Loaded'); }); } })