I added some js files in my custom theme using the file \app\design\frontend\<vendor>\<theme>\Magento_Theme\layout\default_head_blocks.xml
<link src="js/modernizr.custom.28468.js"/>
<link src="js/jquery.js"/>
<link src="js/bootstrap.min.js"/>
<link src="js/wow.js"/>
<link src="js/jquery.bxslider.js"/>
<link src="js/jquery_select.js"/>
<link src="js/page.js"/>
But it shows some errors in console, and functionality is not working properly
image
Any help will be appreciated.
I added some js files in my custom theme using the file \app\design\frontend\<vendor>\<theme>\Magento_Theme\layout\default_head_blocks.xml
<link src="js/modernizr.custom.28468.js"/>
<link src="js/jquery.js"/>
<link src="js/bootstrap.min.js"/>
<link src="js/wow.js"/>
<link src="js/jquery.bxslider.js"/>
<link src="js/jquery_select.js"/>
<link src="js/page.js"/>
But it shows some errors in console, and functionality is not working properly
image
Any help will be appreciated.
Share Improve this question edited Aug 9, 2016 at 13:02 VIPIN A ROY 1,7815 gold badges29 silver badges43 bronze badges asked Aug 3, 2016 at 12:20 Hima MohanHima Mohan 1211 silver badge4 bronze badges 2-
I'd hazard a guess that
modernizr...js
is probably dependent on jQuery. Thus jQuery must be referenced before it- I'm sure there's a duplicate, but I can't find a good one. Also using<link>
for JS is an odd practice,<script>
is more conventional: stackoverflow./questions/13739568/… – HPierce Commented Aug 3, 2016 at 12:58 - @HPierce Thanks for your reply. I have changed link to script and give order to jquery.js and modernizer..js. But still it is not working. – Hima Mohan Commented Aug 4, 2016 at 5:08
1 Answer
Reset to default 5This is because of some jquery conflicts in the js files you used. Please add the below code in your first line of page.js
var $ = jQuery.noConflict();