All Questions
6 questions
16
votes
6
answers
32k
views
How to get the base url from a JS file?
I want to retrieve a base URL and append it with my module controller link from a JS file, so it's impossible to use a block to get the base URL. So far I've done this:
define([
'jquery',
'mage/...
2
votes
2
answers
9k
views
Module JS - Mismatched anonymous define module
I've tried adding my module JS file to Magento2 but for whatever reason it seems to return this error:
Error: Mismatched anonymous define() module: function($)
My view/frontend file structure:
|-...
2
votes
3
answers
3k
views
Magento 2: Adding JS from module
I have a module, and I want to add a javascript generated in the module at the frontend footer.
The javascript has to be built dynamically because it depends on server variables. I've thought of a ...
4
votes
3
answers
5k
views
Is there a some solution to use npm packages within a Magento 2 module?
The main idea - don't keep JS files which belong to some NPM packages in a module repository?
Maybe someone have some solution of thoughts.
2
votes
1
answer
13k
views
How to add JS messages from custom module?
How do I add messages using Magento 2 Ui messages to page via javascript from a custom module?
I have found a file in Magento/Ui/view/frontend/web/js/view/messages.js that appears to be responsible ...
0
votes
3
answers
3k
views
Uncaught TypeError: $el.ColorPicker is not a function Magento 2
Magento ver. 2.0.18
I created a custom module in backend there is color picker options.
for this i used this link color picker answer of @EmizenTech
it works perfectly but some time it gives and if ...