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

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.

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.