function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Rohit K SethiRohit K Sethi 

How to use JQuery in Aura Component ?

Hi All,

Please send me an example which is included the jQuery.

Thanks.
Aakanksha SinghAakanksha Singh
Hi,
You can refer to the following link:
https://developer.salesforce.com/blogs/developer-relations/2015/05/loading-external-js-css-libraries-lightning-components.html
Thanks
Dileep KumarDileep Kumar

Hi,

You can use this link:

 

https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/aura_compref_ltng_require.htm

If it will helpful.Please mark it as best answer.

Thanks

Ajay K DubediAjay K Dubedi
Hi Rohit,
You need to follow below steps:
1. Download JQuery plug-ins according to your requirement and upload its zip file into static resource.
2. Call your file in aura component using: <ltng:require scripts="{!$Resource.jQueryzipfile}" afterScriptsLoaded="{!c.controllerfunctionName}" />
3. Now apply jQuery in controller:
 ({ 
    controllerfunctionName : function(c, e,h) {
         jQuery("document").ready(function(){
           --------code-------          
        });
    }
})
I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.
Thanks,
Ajay Dubedi