Showing results for 
Search instead for 
Did you mean: 

include 3rd party js


include 3rd party js


using 2.2.2 in developer mode. I've put this inside the <head> tag of default_head_blocks.xml:

<script src="js/query.matchHeight.js" />

and ofc I did put the file inside the web/js folder of my child theme, but the page tells me cannot find the file. I also forced a deploy static content with no luck.

What am I missing?

Thanks a lot


Re: include 3rd party js

If you want to add js in head tag of layout file then try below code :


        <link src="js/query.matchHeight.js"/> 


Then run bin/magento setup:static-content:deploy command it will works.


if issue solved,Click Kudos & Accept as Solution

Re: include 3rd party js

Keep your js file inside app/design/frontend/{Vendorname}/{themename}/web/js/query.matchHeight.js


You can use any script or link tag to show your js.

create file default_head_blocks.xml file in your theme,

<?xml version="1.0"?>
<page xmlns:xsi="" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
        <script src="js/query.matchHeight.js"/>
        <!-- <link src="js/query.matchHeight.js"/> -->
    <body />

Run comand,

php bin/magento setup:static-content:deploy -f
If Issue Solved, Click Kudos/Accept As solutions.