0

We have face problem we implement some slider and also we have wrighten many script in phtml. If we add the jquery library then magento is giving the error in core files and all script are stopped accept my cutome script once i remove the the jquery library then core script are working but my custom script are not working its giving jquery not define you can see error below url.

http://php-scripts-form.blogspot.nl/2017/09/magento-2-how-can-we-use-jquery-without.html

asked Sep 1, 2017 at 11:43

1 Answer 1

1

It is not possible to use jQuery without "require(['jquery'],function($){" this code in Magento2.

If you add the jquery library directly in head section for your custom script than the Magento2 is giving the error.

As per Magetno2 coding standard all the external js library you must use using requirejs.

So you can write your any custom script by loading jQuery (or any external library) first using requirejs.

answered Sep 1, 2017 at 11:56
2
  • have no any way to use without conflict jQuery. :( Commented Sep 4, 2017 at 4:56
  • i think there should a way to use jQuery because in codding have no any impossible things. Commented Sep 4, 2017 at 4:58

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.