Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [javascript]

JavaScript (JS) is a client side script language which allows to interact with the user, control the browser, communicate asynchronously, and alter the document content that is displayed. By default Magento 1 comes with the prototype.js library and Magento 2 comes with jQuery. Use 'prototype-js' and 'jquery' tags for questions about those libraries.

0
votes
0answers
2 views

Magento 2.3.1 not loading correct javascript files (tinymce)

I've upgraded from Magento 2.2.6 with Theme Ves Fresh 2. I have tried to clean all caches delete static folder and restart Varnish, but had no luck so far. The errors include: GET https://shop....
2
votes
1answer
21 views

Defer JS / CSS Magento 2 via layout files?

After reading a lot of devdocs, I can see there is case for defer in CSS and JS in the manual https://devdocs.magento.com/guides/v2.3/frontend-dev-guide/layouts/layout-types.html#layout-types-conf ...
4
votes
0answers
20 views

Is it possible to drastically reduce the number of JS files being served from Magento without merging/bundling?

Currently my almost-new Magento 2.3.1-based website with a lightly modified theme is sending 170 JavaScript files to the browser, just to serve the home page. To me, this is not remotely acceptable. ...
1
vote
0answers
21 views

Magento 2 Issue with JavaScript and CSS Merge

I have checked my site for speed and it was requesting 251 requests. I have merged all JavaScript and CSS files and again tested it but still 251 requests are there. While in view page source I can'...
0
votes
0answers
13 views

JS Error after adding bootstrap 4.3.1 files in magento 2 custom theme

ERROR Uncaught TypeError: jQuery.ajaxSetup is not a function at jquery-migrate.js:301 at jquery-migrate.js:521 (anonymous) @ jquery-migrate.js:301 (anonymous) @ jquery-migrate.js:521 require....
0
votes
0answers
10 views

Bundle label display

How do I display a label overlay for thumbnails, on bundle products? Is this difficult or should I find a extension. Thanks for help. Best regards Martin
1
vote
1answer
22 views

magento 1.10 unable to upload image

I have tried to save the image in product page in Magento 1.10, but give me this type of error: jquery this.images.toJson() not a function. Please See this screenshot Please help me find the ...
2
votes
2answers
42 views

Magento 2 secret key problem

I've a form that performs an Ajax call to a controller, but the response always is You entered an invalid Secret Key. Please refresh the page. PereiraTech/Faturamento/Controller/Adminhtml/Ac/Index....
1
vote
0answers
23 views

AJAX call returns the same page html

I have a module that I need to do a php GET action and get some informations from php file. The problem is that the returned value is the Dashboard html. Faturamento/Controller/Adminhtml/Ac/Index....
1
vote
0answers
21 views

Defer parsing of JavaScript issue of recaptcha js

facing problem in defer parsing of javascript 2 3rd party javascript is not defer http://prntscr.com/nau390 is per gtmatrix give information ill also pass the async http://prntscr.com/nau3kw
0
votes
0answers
18 views

Return PHP values inside JS file

I have an module that I need to load some informations when the user clicks at the sync button (backend). The problem is, how to retrieve the values from the js file and put them in the form. view/...
0
votes
2answers
20 views

Integrate js with button on uiComponent xml

I have the following custom form in my admin html and I have tried to insert a javascript function on my custom button click but the page being in a infinity loading loop. view/adminhtml/...
2
votes
0answers
31 views

JavaScript Bundling Not working in Magento2

I have refered https://devdocs.magento.com/guides/v2.2/frontend-dev-guide/themes/js-bundling.html for javascript bundling: After doing all the step i have check Network in browser and it seems found ...
3
votes
3answers
22 views

Uncaught ReferenceError: $ is not defined at pricing.js:122 in magento 2.3.0

Hi am getting an uncought referecne error when adding a custom JS in my theme. On the console I am getting this error- pricing.js:122 Uncaught ReferenceError: $ is not defined at pricing.js:122 My ...
0
votes
1answer
26 views

CountDown Timer not Working

I am trying to implement this circular timer on product Detail page by following the instructions. my catalog_product_view.xml code is <?xml version="1.0"?> <page xmlns:xsi="http://www....
0
votes
0answers
24 views

Override RequireJs Config

So as we all know Magento has always had a massive js overhead, I'm trying to reduce some of this by removing some unnecessary scripts. I know how to override a script or extend one, but how do I ...
0
votes
1answer
50 views

Magento 2.3 - Uncaught TypeError: Cannot read property 'version' of undefined [closed]

Installed Magento 2.3.1 with sample data there are no js errors on the console. After changing the theme to Ves Need from Venustheme. http://www.venustheme.com/theme/ves-need/ On hard refresh, the ...
3
votes
1answer
30 views

I have this error file Uncaught Error: Mismatched anonymous define() module, In my .js file

Good Morning Every Body When I compile my js file , in my console have this error What I Doing Wrong?
0
votes
0answers
22 views

Magento 2: access quote via javascript

I have a piece of javascript that acts upon the reloadPrice function. It inserts a block of html into the dom to add a corresponding sample product (cloth sample for sofas). This works fine so far. ...
0
votes
1answer
26 views

JavaScript Change in custom module not refreshed by deployment

I am going crazy right now. I made a change in a JavaScript file in a custom module which is installed via composer from my own repo. But I can't, under any circumstances, get those changes reflected ...
0
votes
0answers
21 views

Magento 2, third party js script in header gets loaded more than once

Since customized home page layout refreshes the page, added script in header from admin panel gets loaded more than once and displays below error in console. How to solve this issue?
0
votes
2answers
73 views

How to get data from custom shipping method in javascript Magento 2

I am making a magento 2 module, and I had to create a custom shipping method but I am not able to get the data of fields in the checkout page : This is a part of my system.xml file <...
2
votes
1answer
33 views

Magento 2.3.0 add custom JS in theme, using require js

I want to add a custom js - pricing.js in my theme folder using require js I call the script in defaultheadBlock.xml <?xml version="1.0"?> <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-...
0
votes
1answer
43 views

Minify CSS Magento 2

It possibile to fix this issue? Where is the file that i can minify? How can i find it? Thanks :) Magento 2.2.2 CE
0
votes
0answers
12 views

Magento 2 paytabs Uncaught TypeError: Cannot read property 'removeAttribute' of undefined

We are using official paytabs extension - https://dev.paytabs.com/docs/magento/ but getting below error at checkout "Uncaught TypeError: Cannot read property 'removeAttribute' of undefined" Is ...
0
votes
0answers
17 views

how to get configurable product id in cart item in magento 2 using js

I want to get the configurable product_id in cart. My Questions 1) I want to get configurable product id using js 2) Also get product attribute values in js
0
votes
0answers
32 views

Defer parsing of JavaScript Magento2

Hello is possible to fix this issue? I know that are external js.
0
votes
0answers
14 views

Include js in select option on phtml magento 2

I need to add the js code which is in script tag in select option on Form.How can i achieve this. <select name="bcity" id="typeOfGlass" class="form-select-dashboard" placeholder="Pakistan"> &...
2
votes
1answer
47 views

Magento 2.3 add chunk of javascript code to my Custom Theme (phtml file)

I need to implement a Few Functions of javascript and a jquery code in to a phtml file in my Custom Theme. I have read about the different way of implementation but I am not sure which is the best way ...
0
votes
1answer
23 views

Minify inline javascript in magento 2.1 EE

I found a solution to minify javascript using the following link https://gist.github.com/lewisp6/b7c50b4d82ef4d3d5d6dc888e8d1bdba At what path should I place this script?
0
votes
1answer
23 views

Magento 2 how to add a Javascript addeventlistener to element

I am trying to add an event listener to an element, but no matter what I try, it won't work. Here is what I have so far (this is in the html web templates page): window.addEventListener('load',...
1
vote
1answer
24 views

Clicking on product color triggers change in all products

I want to show the product's special price in the catalog but I am getting an error when there is more than one product with a discount. One color product's click triggers a change in all catalog. I ...
2
votes
2answers
54 views

Admin Dashboard - Unexpected token } in JSON at position 33

I know there are many questions here about the unexpected token in JSON error but nothing seems to apply in my case. In my case I log into the admin backend and get this error: I managed to find the ...
0
votes
0answers
50 views

Save Button Not Working in Admin Form Custum Module Magento 2

I am Working on A magento 2 custom Module i have a Form as well a Product Grid in my form so i created tabs using block but Whenever i click on save button gives me Javascript Error TypeError: $....
2
votes
0answers
42 views

Magento 2.2.7 checkout JS Components will not be loaded

After I updated from Magento 2.1.5 to 2.2.7 my checkout is not working any longer.When i click checkout button it continuously loading
2
votes
1answer
60 views

TypeError: require is not a function

I add JS file in custom module Vendor\Module\view/adminhtml/layout/default.xml <?xml version="1.0"?> <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="admin-1column" xsi:...
1
vote
1answer
23 views

Magento theme displays errors and responsive display after refresh

We have a Magento webshop (1.9.3.2) with Ultimo theme, which appears to have some strange problem in a few browsers - we've discovered it's only on Chrome and Opera so far. When you first watch the ...
0
votes
1answer
47 views

Magento 2 add Custom CSS and JS file in admin panel

How can add CSS and JS File in admin panel of specific page.too many pages in admin panel e.g product,sales->order ,order view ,invoice,ship etc . . . I want to load 1 CSS or JS file in New Invoice ...
4
votes
1answer
125 views

TinyMCE Issues in Magento 2.3

I'm having some issues with TinyMCE, which is causing the editor not to work on CMS pages and causes products not to load when attempting to edit them. When these issues are happening, I see this in ...
0
votes
1answer
31 views

TypeError: stepNavigator.setHash is not a function in checkout Magento 2

TypeError: stepNavigator.setHash is not a function I have a javascript error in the console like above, because of this error some shipping method is not showing properly. Can anyone please tell ...
2
votes
1answer
15 views

Magento2: How to add script .js to block

I want add script with reviews to custom_block in magento 2. <span id="__ceneo-reviews-5404f405-e31c-4e74-9b51-0ebeee8bcd2d"></span> <br/> <small> <a href="https://www....
1
vote
1answer
21 views

Masonry in magento 2

does any body have idea that how to include masonry in magento 2? as i added requirejs-config.js them in masonry i used require on the top of the code then i added this code in bottom of list.phtml ...
1
vote
0answers
22 views

How to select a shipping method if the default address is present in checkout page in Magento 2?

I need to select the first method rendering in the list as the default selected among the shipping methods in the checkout page for a customer whose default shipping address is pre-populated in the ...
2
votes
1answer
58 views

How to pass variable from phtml and how to get variable in require js file

How to pass parameter form .phtml to require js file Template file <script type="text/javascript"> require(['Namespace_Module/js/custom'], function () { }); </script> JS ...
2
votes
2answers
60 views

How to add custom checkbox with event in customer registration Magento 2?

I'm working on creating a custom checkbox with an event <div class="field tcagreecreateaccount required"> <div class="control"> <input type="checkbox" id="...
0
votes
0answers
32 views

Magento 2.3 - While in backend i get js error “cannot read propery map of undefined” then logs me out of backend

TypeError that is happening and it doesnt happen on a specific page. it happens throughout the backend and then logs me out.
2
votes
1answer
25 views

how to add onclick method in magento2 admin custom module page?

my edit.php file in magento admin custom module $this->addButton( 'approve', [ 'label' => __('Approve'), 'onclick' => 'deleteConfirm('...
4
votes
0answers
33 views

How to create a basic progress bar with ajax, when il click add to cart in Magento 2?

I try to make a basic progress bar with ajax , when I click button add to cart, but I don't know how catch the xhr on console,to put on alert() or prepend()function I follow a video example in ...
1
vote
1answer
36 views

I just implemented Bootstrap 4 in my magento 2.2.5 website. Require.js 166 Error

In my environment implemented Bootstrap 4 in Magento 2.2.5 at first glance it seemed to work. all of my js and css worked perfectly without any error's. But after sometime, I got error: Uncaught Error:...
1
vote
0answers
22 views

Google Chrome is failing in loading require.js files in time

On Magento 2 (ver 2.2.5), with Google Chrome (ver 72.0) I'm getting a wired error I wasn't getting withe previous Google Chrome version (ver 71). When I visit a product page, I get more then one ...