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

Magento 2 | VueJs Framework

Is there a way to use VueJs Framework under Magento 2 ?
0
votes
1answer
23 views

JS issue with Magento 1.9.4.1 Adminhtml

We recently upgraded our magento 1.8.1 install to 1.9.4.1, we also changed our php version from 5.6.4 to 7.2 However we are now getting an error when looking at the product page Uncaught DOMExeption:...
0
votes
0answers
12 views

Magento2 How do I see the raw files, I'm just on the admin

I'm very new to this, I'm doing this for a client. I see there is a content section where I can edit the blocks. I suppose I can edit the custom js to add a javascript file to call my API. I'm try to ...
0
votes
0answers
13 views

Magento 2 Assign customer group name to externally calling JavaScript file variable

PreRequisites: MageVersion - Magento 2.3.x External JavaScript - http://domain.com/external-js.js var mage_customer_group = ''; //other code related to the customer group Pages - Category page and ...
1
vote
0answers
37 views

Magento2.3 : How do I programmatically submit a form generated via a UIComponent?

I created a UI Component form, but I am unable to find the element in the source. I would like to click a button and then inspect a field in the form and dependent on what value is selected submit ...
0
votes
1answer
27 views

how to add js in custom form in backend magento 2

I have used this code in my form to manage the field id_pdt that is a foreign key so i will put a text from bar code and then search in mu custom table to find if the sku exists in table product and ...
0
votes
1answer
16 views

How to include script with out using document.write function [closed]

Hi I want to include the external script inside the another script. Like : <script type='text/javascript'> function callScript() { var test = Math.random()+''; test = test * 1000000; ...
1
vote
1answer
28 views

How to add 3rd party js library to Magento 2

I am trying to install the following slider to my own Module https://owlcarousel2.github.io/OwlCarousel2/demos/demos.html. But unfortunately, Magento has its own complicated mechanism to manage its ...
0
votes
1answer
24 views

Add onclick function to input

I want to add a js function to an input field located in a phtml page on my magento 2 I have write my function like below: <script> function qtyzn() { ..... }...
2
votes
1answer
32 views

Overriding function from the modal.js file

How can I override a function from the modal.js file in the path vendor/magento/module-ui/view/base/web/js/modal/modal.js ? In this file, line 307, is a function with name closeModal() that I want to ...
0
votes
0answers
28 views

Magento2 add js custom conversion tracking on thank you page on first time load

I'm editing a client's site and I need to add custom javascript for our purchase tracking, on a success or thank you page. Oh shopify we put it on the checkout input box custom script input window ...
1
vote
0answers
13 views

UI Components - pass ids selection to listing selection

How do i pass a selection of ids to an insert-listing component to preselect certain rows. I have a dynamic rows component with entries related to the current product I'm editing. When click on a ...
1
vote
0answers
17 views

Failed to load JS and other support files while trying to checkout

I am trying to add a product in cart and check out the product, page still loading and it shown error message. enter image description here
2
votes
0answers
19 views

How to pass variable value from phtml JS to block.php?

I have a phtml (system.phtml) with <script> in it and a variable like console.log(data). <?php $checkcustomer = $block->Customerlogin(); ?> <script src="https://d3js.org/d3.v3.min....
2
votes
2answers
23 views

Magento2 : I am getting this error when i upload two custom module and css and js file

I am getting this error on my live site as production mode and I uploaded only two custom module and js and css and two overwrite file in our theme.Below share error as warning showing I apply all ...
2
votes
3answers
31 views

Magento bad execution on js and css

i have a issue when a try to access to my Magento Admin Panel and frontend default page. the admin panel always shows epmty And the frontend default page show content but without CSS and JS: how to ...
0
votes
1answer
15 views

How can active accordion tab on click

I want to active an accordion tab on button click with activate() method https://devdocs.magento.com/guides/v2.1/javascript-dev-guide/widgets/widget_tabs.html#fedg_tabs_methods-activate This is my ...
6
votes
3answers
162 views

Magento 2 Advanced Js Bundling

Can any one worked on Advanced JS Bundling? We would like to apply this concept to one of our client projects. Could you please explain about Advanced JavaScript bundling in detailed step by step &...
1
vote
0answers
12 views

Backend listing grid view page not opening order listing cms page & block listing etc

Backend listing grid view page not opening order listing cms page & block listing etc.. Admin panel not able to load multiselect.html, text.html, html.html, actions.html and js file as per console ...
1
vote
0answers
15 views

cms pages and block is not loading in backend

CMS pages and blocks won't load in the backend. It keeps loading and loading without not showing any pages or blocks. I reindex, compile, clear cache... But nothing changed. Any help would be much ...
1
vote
0answers
20 views

Add multiple products to cart using product ids

I am trying to add multiple products to my cart. I have product ids in the form of $productIds = implode(',', array_column($points, 'productId')); which gives me numeric product ids like this : 5330,...
1
vote
2answers
42 views

MagenImage Upload File Extention JS Validation?

I'm new to Magento 2.3, i want to validate file upload field. Allowed file formats: jpeg. I put a method in lib\web\mage\validation.js require([ 'jquery', 'jquery/ui', '...
0
votes
0answers
17 views

Magento 2 + NGINX + REDIS + VARNISH + SSL Changing to Developer mode

in Production Mode everything is fine. When i change to Developer Mode i have this Problem because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is ...
0
votes
0answers
21 views

Language and currency switcher js error

Added language and currency switcher to template using this below layout. <block class="Magento\Framework\View\Element\Template" name="store.settings" group="navigation-sections" template="...
1
vote
1answer
58 views

Magento 2 custom module set the css and js file using the check the particular product attribute is enable or not

I have a custom module.I want to the add the css and js file if my custom product attribute value is available. In xml I can't check product attribute value is available or not. so what i do? ...
2
votes
3answers
74 views

How to hide fields with toggle checkbox in ui_component Magento 2

I have a toggle checkbox at product edit form: Created as: <field name="open_amount" formElement="checkbox"> <argument name="data" xsi:type="array"> &...
1
vote
1answer
50 views

Magento 2 admin css and js not loading after trying to change admin URL

To change my admin_url of Magento I did it first with: Store > Advanced Tab > Admin Base URL section After that the admin CSS and js weren't working and to solve that I tried it with the ...
0
votes
1answer
22 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
17 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
27 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
13 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
28 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
45 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
9 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, ...
1
vote
0answers
116 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
39 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
42 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
41 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
27 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
29 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
51 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
29 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
41 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
33 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
38 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....