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.

671 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
1
vote
2answers
38 views

How to Validate Special Characters in Magento 2 Validation Mixin

I want to validate special characters in a custom validation mixin file (validation-mixin.js) When I am using this validation mixin for my input field, i.e. a Purchase Order Number in checkout, it ...
1
vote
0answers
13 views

Define an event on select with event observer

My template is located in src/app/design/frontend/MySite/default/Magento_Checkout/templates/cart/item/default.phtml There is a select and in this select I'm adding an event. <select id="cart-<?...
1
vote
0answers
18 views

eliminate render blocking resourcejacascript with .pagespeed extension

I am getting error Eliminate Render Blocking Resource in file, it is having the extension of .pagespeed.*js /media/js/fe2e6f53276726439b1fac7296dd6414.js.pagespeed.jm.nywy_6kRdV.js I installed ...
1
vote
0answers
18 views

Magento 2 : Cart keeps returning original quantity

I am trying to update the value of the qty in the shopping cart page with a Knockout on click, but it seems to revert the value to it's original state. This is the script for the button : <td ...
1
vote
0answers
55 views

Magento 2 : Firefox javascript update not working

I am trying to create buttons to either add or remove 1 item of a certain type from the shopping cart. In my search I found some code online that works great for Chrome but appears to not work on ...
1
vote
0answers
13 views

Production Mode - CSS/JS missing when reloading with CTRL + Shift + R

Hello everyone, As the title suggests, I'm currently having some problems with a Magento 2 site, running in production mode, and it's static content / caching. The website loads just fine, but when I ...
1
vote
0answers
19 views

eliminate render blocking resource in magento 1.9

how to eliminate render blocking resource, please give some solution. and in below URL https://example.com/media/css_secure/A.67235d48adca9db7ca959bc3a5076d7a.css.pagespeed.cf.Zdz540Fens.css what is ...
1
vote
0answers
21 views

what is media/js folder in Magento 1.9

what is the media/js folder in Magento 1.9? In the w3c validator, it is showing error. How to resolve those errors that are showing in the w3c validator. Please help
1
vote
1answer
42 views

Disable (product data items) tabs in Product page

I want to disable tabs in product pages, i mean not display product data items (description, more information,Ratings) as tabs. So I override web/css/source/sections.less And remove tabs and ...
1
vote
0answers
23 views

Magento 2 not working on Samsung Internet

Currently experiencing an issue with Magento 2 on the Samsung Internet browser. This occurs on most pages, though it's more prominent (and a bigger problem) on the checkout. The checkout takes ...
1
vote
0answers
91 views

Executing Jasmine tests for frontend theme's

I can't get some of the Jasmine tests for the frontend (blank and luma themes) to work. I have generated the static files as described in the documentation. $ bin/magento setup:static-content:deploy ...
1
vote
0answers
35 views

Show all error messages in one place in one page checkout

I want to show validation messages in one place. for example. <div class="checkout-error-message"> * Please fill address field * Please fill email field * Please check agreement and term </...
1
vote
0answers
19 views

Fire JS script in observer

How can i fire this JS with an observer every time a user is adding, updating or deleting a product from the cart ? <script type="text/javascript"> _paq.push(['addEcommerceItem', "{{...
1
vote
0answers
12 views

How to list all JS outputed via module?

I want to have all the JS outputted as it's in the HTML, so if the bundle, minify and CDN are enabled or not I would like to get the URL listed via my module. How could I do that?
1
vote
0answers
67 views

Advanced JS Bundling - What to include/exclude

So, I've been doing an advanced js bundling for my website and I've read a lot of information about it. I've decided to use m2 dev tools to help me do it, however, I've some doubts with the result I ...
1
vote
1answer
16 views

Magento1.9 : Translate validation messages for different stores

In my having two stores France and German.I want to validation error messages with their particular languages.How can I do it with my Js script? My code <label for="sample" class="required"...
1
vote
0answers
33 views

How to hijack a button's click event with my own ajax get function? Magento 2

I am tying to add a new button to an existing admin page. I want to call an ajax get() function on this button click. I created a main.js script file which I see is loading on this page since when I ...
1
vote
0answers
26 views

Code Pattern to Define and Use Javscript Callbacks / Hooks

We are using a third party module, that updates prices via AJAX on product / category pages. No we have to react on this update, to update some custom pricing logic. Of course we do not want to patch ...
1
vote
0answers
102 views

Magento 2: Autoplay product video when video icon on left panel is clicked?

I want to autoplay video when video icon on the left panel is click. Once the video icon is click the video on the container will automatically play. Here is the current classes on the video icon: ...
1
vote
1answer
33 views

Script executar apenas para algum manufacture

I want to make javascript at the end of the file run only if the product is not from the "hello-kitty" manufacturer but for that I need to somehow take the manufacturer of the product to store in a ...
1
vote
0answers
44 views

Override Fotorama

I am create requirejs-config.js and write let config = { config: { mixins: { 'fotorama/fotorama' : { 'Vendor_MOdule/js/fotorama/fotorama-mixin':true, ...
1
vote
0answers
25 views

Magento 2.2.9 question about foreach data into popup modal

I am trying to do a popup modal with this information I have in an array. I have ID, NAME and DESCRIPTION So in a function, I have done foreach to gather all the information and i am showing it on ...
1
vote
0answers
270 views

Magento 1.9 - How to set PCI Compliance script integrity check for merged js file

I had scan the site with PCI scan. But it is failed and its score is 7.8. Following are the scan results of PCI scan: Title: Script Src Integrity Check Synopsis: Report external script resources not ...
1
vote
0answers
25 views

Magento 2.2.9 - Admin page error console-logger.js

I did an update from Magento 2.2.7 to 2.2.9 and now when I want to access to the admin page I have an error message : main.ERROR: Unable to resolve the source file for 'adminhtml/Magento/backend/...
1
vote
0answers
152 views

Code Coverage with Jasmine Unittests in Magento2

I am trying to set up the jasmine Unittests for Magento 2. I've already edited the settings.json inside the dev/tests/js/jasmine/spec_runner directory, to only test my own unit tests because I don't ...
1
vote
0answers
237 views

React Router Breadcrumbs use page titles instead of url dynamically

I've got a magento 2.3.1 site with venia storefront a react front end and I'm trying to get the breadcrumbs to pull the page titles dynamically rather than pulling the url. My current code for the ...
1
vote
2answers
214 views

Magento 2: jQuery Datatables Button Extentions Not Working

============================UPDATED 1.1============================ I'm new to Magento 2.3, I'm trying to apply jQuery DataTable(DONE), after than, I want to add it's Button Extension, for that i ...
1
vote
0answers
68 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 ...
1
vote
0answers
22 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
1
vote
0answers
19 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
17 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
26 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
262 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', '...
1
vote
0answers
48 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 ...
1
vote
1answer
46 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
91 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
57 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'...
1
vote
0answers
130 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
1answer
542 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. ...
1
vote
1answer
26 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 ...
1
vote
1answer
81 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
53 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 ...
1
vote
1answer
157 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
1answer
273 views

How to use owl carousel using require js in magento 2

Anyone can help me out how to use owl carousel using a custom theme by using require js I have downloaded owl carousel zip file from an official website. I want to use this owl carousel in my block ...
1
vote
1answer
267 views

Uncaught Error: Mismatched anonymous define() magento 2.2.4

Below is the console erros is getting in frontend. Checked .htaccess in pub, pub/static and root all .htaccess are identical to Magento 2.2.4 version. js bundling/minification is enabled and ran ...
1
vote
0answers
111 views

Show magento loader ajax

how can I show the loader only on my div and not on the body during an ajax call ? Can't make it work. Here's my code, I have the show loader and the context but I'm missing something ? <div id="...
1
vote
0answers
26 views

Magento2 : Fire body loader with text/x-magento-init

i have a custom block on my page, that calls javascript via text/x-magento-init and performs some operations so loader should be displayed untill that script will finish its operations. How can i fire ...
1
vote
1answer
28 views

Adding JS code Always showing below footer

I am inserting JotForm JS code in specific CMS Page but it always showing after footer. Even when I add jQuery CDN, it always showing after footer. I have tried head.phtml, header.phtml, CMS page ...
1
vote
0answers
26 views

how to download wishlist in excel format in magento 1.9

i want to download my wishlist in excel format without any plugin, currently i'm able to download my wishlist as docx type. Please help.
1
vote
0answers
21 views

Closure Compiler support

It seems there are several performance extensions for Magento 2 but none of them mention Closure Compiler which still yields the best results compared to the current minifier. The extensions which I ...

1 2 3 4 5 14