Skip to content

javascript

Auto Added by WPeMatico

My build.js is not adding generated bundles in requirejs-config.js file

I followed closely enough the Magento devdoc on advanced JavaScript bundling for better store performance. I see that pub/static/frontend/Perfectmakeupmirrors/argento-luxury-custom/en_US/bundles has all the bundles created. Something is wrong somewhere which is why these bundles are not present in requirejs-config.js. Please have… Read More »My build.js is not adding generated bundles in requirejs-config.js file

Magento 2: Including External JS – Uncaught Error: Mismatched anonymous define() module

Trying to include an external JS file on a specific page. Currently using the following in my layout: <?xml version=”1.0″?> <page xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” xsi:noNamespaceSchemaLocation=”urn:magento:framework:View/Layout/etc/page_configuration.xsd”> <head> <script src=”https://js.braintreegateway.com/web/dropin/1.14.1/js/dropin.min.js” src_type=”url”/> </head> </page> I see the script included in the head of my page… Read More »Magento 2: Including External JS – Uncaught Error: Mismatched anonymous define() module

Frontend JS get access to attributes?

Is it possible to get Magento attribute values on product page when writing custom java script code? I am working on a frontend script where i need access to the product sku to check some logic i am writing.