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
1answer
23 views

how i can get the row values by clicking button in that table using jquery magento 2

<td data-th="<?php /* @escapeNotVerified */echo __("Quote Id")?>" class="col quoteid"> <span class="label"><?php /* @escapeNotVerified */...
0
votes
0answers
19 views

JS Errors after changing deploy mode developer to production

I simply change my application mode form developer to production. php bin/magento deploy:mode:set production Result- Deployment of static content complete Disabling maintenance mode Enabled ...
0
votes
1answer
44 views

How to extend admin js in magento 2 by mixins

I want to overide Magento_Sales/adminhtml/web/order/create/scripts.js I wrote require-config.js for this var config = { config: { mixins: { 'Magento_Sales/adminhtml/web/...
1
vote
0answers
20 views

magento 1 checkout page gives error “checkout is not defined” in console prototype.js::5598

i am using firecheckout for magento 1 checkout page gives error "checkout is not defined" in console prototype.js::5598. because of that error sometimes customers can not place order. can anyone help ...
3
votes
1answer
33 views

How can i add a custom javascript module to custom module?

Hi this code is working perfect without magento. <script src="flipbook.js"></script> <script src="jquery.js"></script> <script> $('#side').FlipBook({ pdf: '...
1
vote
2answers
46 views

How to override post-code.js which is in vendor/module-ui?

For testing purpose, we have modified the core file post-code.js which is in the path /vendor/Magento/module-ui/view/base/web/js/form/element and see it's working fine. So we have decided to override ...
1
vote
1answer
22 views

Some unwanted random values appending in script tag

I have removed some malware from a website but my googleads is not approved. I asked them they said there is an issue with javascript tag. I want to know is that correct or not. Our default script ...
1
vote
0answers
11 views

Uncaught ReferenceError: Mini is not defined at (index):993 - magento 2 store

How do i trace and fix this error for my magento 2 store? Uncaught ReferenceError: Mini is not defined at (index):993 i can not find the below code anywhere in my magento admin. it is not in header, ...
2
votes
0answers
191 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....
3
votes
1answer
84 views

Defer JS / CSS Magento 2 via layout files?

After reading a lot of devdocs, I can see there is a case for deferring in CSS and JS in the manual https://devdocs.magento.com/guides/v2.3/frontend-dev-guide/layouts/layout-types.html#layout-types-...
4
votes
1answer
56 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
42 views

Magento 2 Issue with JavaScript and CSS Merge

I have checked my site for speed and it was requesting 258 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
54 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
31 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
59 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
24 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
31 views

Defer parsing of JavaScript issue of recaptcha js [closed]

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
19 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
23 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
52 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
38 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 ...
1
vote
1answer
40 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
29 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
487 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
37 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
70 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
28 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
2answers
104 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
78 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
44 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
16 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
26 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
35 views

Defer parsing of JavaScript Magento2

Hello is possible to fix this issue? I know that are external js.
0
votes
0answers
24 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
50 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
31 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
41 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
27 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
69 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
263 views

Magento2 : Save Button Not Working in Admin Form Custom Module

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
51 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
340 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
149 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 ...
6
votes
2answers
613 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
82 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
16 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
36 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
37 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 ...