0

I am facing that is slider images on my site does not appear on the first attempt and I get the following error but when I refresh page sliders appears

Uncaught TypeError: $(...).swMegamenu is not a function Uncaught TypeError: $(...).owlCarousel is not a function collapsible.js:20 Uncaught TypeError: $.widget is not a function

Can anyone please help me with this

Amit Bera
77.8k21 gold badges127 silver badges240 bronze badges
asked May 16, 2018 at 18:54
1
  • Please share your code, where you have called that swMegamenu? Commented May 16, 2018 at 18:58

1 Answer 1

1

You should use always require js to call custom js

<script type="text/javascript">
require([
 'jquery'
], function ($) {
 Your Code ....
 });
});
</script>
answered May 22, 2018 at 11:46
1
  • I recommend adding all JS to JS files rather than inside templates with a script tag. Commented May 22, 2018 at 13:59

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.