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.

Filter by
Sorted by
Tagged with
0
votes
1answer
836 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: $....
1
vote
1answer
14 views

PWA for Magento2 - best option now?

We would like to develop a PWA storefront with Nuxt.js. Vue Storefront for Magento 2 doesn't utilize Nuxt.js and it will be many months (or longer) before Vue Storefront Next (the version built with ...
1
vote
1answer
18 views

Is it possible to load data from the server using a HTTP POST request within a Magento Module js file?

Is it possible to load data from the server using an HTTP POST request within a Magento Module js file? File located in app/code/MyVendor/myCustomModule/view/frontend/web/js/mycustom.js Example ...
1
vote
0answers
21 views

Magento2 JS override

How to override Plumrocket_CartReservation/js/prcr file in the local module not in theme var config = { map: { '*': { 'prcr': 'Plumrocket_CartReservation/js/prcr', '...
1
vote
1answer
49 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 ...
0
votes
1answer
12 views

How to use reactjs with magento 2?

I want to use reactjs in my magento 2 module for designing or developing PWA. edit:- how to integrate jqery with magento 2
1
vote
3answers
48 views

How to get store logo url in Javascript file in Magento 2?

I want to load store logo image URL in javascript so i can bind it to my knockout element, how can i achieve that?
3
votes
2answers
909 views

Magento2 site is not loading properly

I have Magento2 site. When I load first time in the browser it's not loading. Complete and show javascript error in the console but when I refresh, it shows correct? What is the issue in Magento 2
0
votes
2answers
786 views

Add a javascript file in Magento 1.9

I'm discovering magento since 1 week. But i have a problem now. I need to include a javascript file in my admin panel to sort a list according to another. I'm using magento 1.9 and i really don't find ...
1
vote
0answers
19 views

Magento 2 Uncaught TypeError Cannot read property 'done' of undefined

Uncaught TypeError: Cannot read property 'done' of undefined at UiClass.continueToPayPal (paypal-express-abstract.js:80) at HTMLButtonElement.<anonymous> (knockout.js:4245) at ...
0
votes
0answers
7 views

categories link opens with mouseover whereas in mobile menu its works onClick i want a onClick drop down on desktop view as well in side menu

(function (factory) { 'use strict'; if (typeof define === 'function' && define.amd) { define([ 'jquery' ], factory); } else { factory(window.jQuery); } }(function ($) { '...
1
vote
0answers
11 views

Magento2 eslint entire custom code

I've noticed Magento2 has Javascript Coding Standards, in which they reference an eslint config file. Suppose I have an M2 project I'm developing with a large group of folks and I'd like the team to ...
4
votes
2answers
7k views

How to add a custom dropdown menu in Magento2 to a PHTML template

How can you add a custom dropdown menu in a Magento PHTML template? So far, I've created the template in my theme and the markup is showing on the frontend. This is the markup I'm using <div ...
9
votes
6answers
12k views

Magento 2: How to use Cookie?

How can we use cookie in magento 2 to store data.. i'm trying to store data in cookie, on vendor/magento/module-checkout/view/frontend/web/js/model/resource-url-manager.js to store selected ...
1
vote
0answers
149 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 ...
0
votes
1answer
14 views

How to add a green border if validation is completed when submitting the form

Magento 2 has basic validation if the field is not valid. How to add custom validation to the checkout page which will add a green border and an inscription that notifies the user of a successful ...
0
votes
0answers
10 views

Magento 2.3.4: How to address "Resources are blocking the first paint of your page. Consider delivering critical JS/CSS inline

Google's web.dev is penalizing the site by displaying this error. Can anyone please suggest what can be done to eliminate these render-blocking resources?
24
votes
1answer
12k views

Magento 2: Uncaught TypeError: Cannot read property '*' of undefined in (section-config.js:33)

It's duplicate question but I am facing the same issue while adding the product & removing items from the cart page. I have spent almost a day to resolve but no luck hope someone could help me ...
0
votes
1answer
19 views

How to add custom inline javascript to Magento head?

I want to add this javascript to the head of all Product Pages in Magento 2. Problem is, I'm not sure where to begin with that. I know, there's built in Google Analytics settings in Magento 2, however,...
0
votes
1answer
19 views

JS VarienForm in Magento 2

Is there a way to update this code to work with Magento2? I believe VarienForm has been depreciated in Magento2 but I can't find a similar JS constructor to get the object. var AddToCartForm = new ...
5
votes
1answer
2k views

Magento 2.2.1 Checkout page broken and Js fail to load error

I have installed Magento 2.2.1 and set up my custom theme but checkout page looks broken and consoles showing errors: Not sure how to resolve this issue. Need help how can this be resolved. How ...
1
vote
5answers
2k views

magento 2 Error: cannot call methods on priceBox prior to initialization; attempted to call method 'option'

I am having an issue on my website the issue Error: cannot call methods on priceBox prior to initialization; attempted to call method 'option' My website https://www.cartaroo.com.cy/?...
0
votes
3answers
2k views

Fixed Header and Mega Menu

I'm new at magento. I'm using luma theme as a blank. I want to fix header and mega menu when page scroll down. Thanks for your helps.
0
votes
1answer
45 views

After upgrade to Magento 2.3 - js error in arrays.js in cart and checkout

I am updating an e-commerce with Magento, from version 2.1.18 to version 2.3.4 (I have verified that it also happens by updating to version 2.2.11). Everything went well, but when I add a product to ...
1
vote
1answer
772 views

Password Strength Meter - Uncaught TypeError: Cannot read property 'toLowerCase' of undefined

I have an issue where the password strength meter on the reset password page isn't working and just says "Password Strength: No Password". I receive the following console error when I enter text into ...
0
votes
0answers
8 views

How to rewrite Js widget which doesn't have return $.mage.widgetName

I'm trying to rewrite JS widget using mixin but getting error Uncaught TypeError: base is not a constructor. If at the end of this widget add return $.mage.widgetName, everything works fine. Can I fix ...
0
votes
2answers
22 views

I want to update order status using magento's rest api

I want to use Magento Api for Updating Status of order in Magento 2.3.5 so anyone can guide me from scratch how can i use api. I also want to know in Magento how many default api is there and how to ...
0
votes
0answers
22 views

Magento 2 checkout loader is stuck

I've seen this question a couple of times, but i wasn't able to solve my problem. My checkout page loads fine but the "loader" gif doesn't go away and I can't interact. Usually refreshing ...
2
votes
1answer
60 views

Magento 2 admin Uncaught TypeError: this.linksFieldset(…).visible is not a function

When we edit product from admin then its showing loading continue and also getting this error "Uncaught TypeError: this.linksFieldset(...).visible is not a function" is showing error in console. We ...
1
vote
0answers
13 views

Is it possible to generate a dependency graph of files included via RequireJS?

In Magento 2 lots of JavaScript files are loaded via RequireJS. Those files, themselves, can also require more JavaScript files, and so on. This can make it difficult to determine where a specific .js ...
1
vote
1answer
27 views

Magento 2 - Custom Module JS error

I am trying to add custom js file using my custom module. But getting below error in console. Uncaught ReferenceError: Plyr is not defined DevTools failed to load SourceMap: Could not load content ...
0
votes
2answers
2k views

How to Magento 2 Enable JavaScript Bundling

I merged JS and CSS file Stores -> Configuration -> Advanced -> Developer -> Javascript Settings in production mode of magento2. Once, I check via view source of the page, I can see the Javascript is ...
0
votes
1answer
18 views

Javascript error productSidebar.js Magento 2.3.3

i'm using Magento 2.3.3, and in my catalog's console i found this error in pub/static/ there's no a folder named "version.." but if you skip that folder you can find directly "frontend/AtelierVM/.../...
0
votes
0answers
12 views

Magento 2 Add js code only for checkout step 2

I want to add a piece of javascript code only for checkout step 2 (payment page). What I have tried so far? Loaded stepNavigator and checked if this returns true. stepNavigator.isProcessed('payment'...
1
vote
1answer
860 views

Magento 2 How to call a ajax function in x-magento-init type javascript?

It seems cannot use jquery lib inside the x-magento-init type javascript. How to call a ajax function in x-magento-init type javascript? Thanks
2
votes
1answer
603 views

Mixin js file in Magento 2

I am attempting to override this file \vendor\magento\module-checkout\view\frontend\web\js\view\form\element\email.js First I create a requirejs-config.js file in C:\wamp64\www\magento222\...
1
vote
1answer
25 views

call a vendor function in custom module

I'm trying to create a custom module which will have GoogleSheet Import functionality. So I want to call varienImport.postToFrame() this function works when we click on Check Data option in existing ...
0
votes
0answers
11 views

Magento 2.3.4: How to remove unnecessary script?

I tried to bundle the script using some known commands, but still having to much scripts. Help me too boost my site. some of google
0
votes
1answer
65 views

Uncaught Error: Mismatched anonymous define() module: function(t,g,u)

I have a fresh installation of Magento but this error is showing on all of the pages.This may be duplicate of some other but I cannot find solution for my problem so asking here. When I trace back it ...
0
votes
0answers
11 views

(Magento 2.3.5-p1) “A technical problem with the server created an error” when editing a category description that has links or HTML comments inside

I created a category description with a style element and some ordinary block-level elements like div and ul, and that worked out fine; then I tried to turn some of the text into links, and whether ...
0
votes
1answer
23 views

How to add a required checkbox to checkout page (policy check)

I know that there is basic functionality, but it does not suit me. How to display my template under the form with the link to the privacy-policy page? Or tell me how to do it right. I need a ...
5
votes
2answers
2k views

Extending/Overriding base JavaScript in Magento 2

AFAIK, the mage.confirm widget is defined in this file: vendor/magento/module-ui/view/base/web/js/modal/confirm.js I'm looking to override the file in my theme to provide alternative default ...
0
votes
1answer
772 views

Product detail page image not loading on front end

Product detail page images are not loading. The pointer is just spinning. I have read lots of threads. Clear cache, reindexed, change permissions. Finally, I got a problem. but unable to fix it. :-/ ...
0
votes
2answers
3k views

Add js in head in magento 1.9

All js script are loaded in footer in magento 1.9. I want them in head. Can Anyone let how to do this ?
0
votes
1answer
210 views

Error while using croppie.js library in magento 2

Trying to use the croppie library on product detail page and sometime it works perfectly but most of the time it throws one of these errors. TypeError: priceBoxes.priceBox is not a function ...
0
votes
2answers
2k views

Confirm Password Validation Not Working

I have an issue with the confirmation password validation on creating the account and reset password pages and showing the following error although the passwords match? Please enter the same value ...
1
vote
4answers
48 views

How to call Function in Javascript Magento2

I want to show alert using function in phtml file as per below but it seems like the function (myfunction) is not calling. <button onclick="myFunction()">Try it</button> <script type="...
0
votes
2answers
23 views

How to Pass Parameters in JS Magento2

I have created one module where I want to pass Parameters using JS. So I have followed as per below. app/code/namespace/modulename/view/frontend/templates/index.phtml <div class="example-...
2
votes
2answers
661 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/...
0
votes
0answers
35 views

How to remake js code on jquery ui widget

I have a simple code that animates the appearance of a mini-cart modal window. <script type="text/javascript"> require(['jquery'], function($){ $(document).ready(function(){ ...

1
2 3 4 5
42