cancel
Showing results for 
Search instead for 
Did you mean: 

Can anyone help me !

Can anyone help me !

I am trying to use JQuery in my block functions, but I get an error saying JQuery not found. I tried google and some suggested to add it to local.xml but I think Magento2 does not have local.xml.

 

Can anyone help me on how to enable JQuery in Magento2?

 

1 REPLY 1

Re: Can anyone help me !

Hello @dona_house 

 

by default magento 2 already provide jQuery.

 

let's example you want to use that jQuery then you need to write

 

 require(['jquery'], function($){ 
     //your js code here  
 });

hope it will help you.

 


Problem solved? Click Kudos & Accept as Solution!
Sunil Patel
Magento 2 Certified Professional Developer & Frontend Developer