The Stack Overflow podcast is back! Listen to an interview with our new CEO.

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.

616 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
1
vote
0answers
57 views

Error in css and js in child theme in Magento 1

I'm having a problem loading style sheets and scripts. I created a child theme, and I did not add any css or js to it. Even so, the magento looks for them in the son theme instead of the father. I'll ...
1
vote
0answers
27 views

how to rewrite magento2 backend menu js

I want to rewrite magento2 js The file path is "vendor/magento/theme-adminhtml-backend/web/js/theme.js", what should i do? Thanks for you helping
1
vote
0answers
19 views

Is it advisable to put JS in the footer? Magento 1.9.x

A query is a good practice to put the JS in the footer in magento 1.9.x? In Google Speed ​​Test tells me that there are resources that clog the page when loading
1
vote
1answer
100 views

JavaScript Merge issue in Magento 1.9

I have one issue, I enabled JavaScript merge option in magento backed but iam getting many issues in checkout page. Please see the image. anyone please help. I need javascript merge because i saw ...
1
vote
1answer
205 views

Magento 2: Browser console error on hard refresh

I am facing some weird issue with Magento 2.2.5 version. When I first-time open website, I am getting lots of js errors. (Screenshot attached) After this, when I only press F5 button (normal refresh) ...
1
vote
0answers
27 views

Magento 2: Translation in JavaScript don't work

I try to translate the next line and this don't show changes: if (pending > 0) { $('#wrapper-freeshipping_alert > p').text($.mage.__('You need %1 more for free shipping').replace('%1', ...
1
vote
1answer
292 views

customer undefined trying to check if logged in

I'm trying to display a registration pop-up only if a user has never seen it before and it occurred to me it would be wise to also check to make sure they were not already logged in. But when I ...
1
vote
1answer
142 views

Magento 2.2.2 Javascript bundle file size only 1Mb

I enabled bundle javascript file, but i saw in my local js file is 3.7Mb and my dev site just 1.0Mb. Here is my config 'dev' => array ( 'js' => array ( 'merge_files' => '1',...
1
vote
0answers
337 views

Magento 2.2.4 Implementing Bootstrap 4 Carousel to Homepage | JS seems to not be functioning

I've been trying to get the Bootstrap 4 Carousel to work on my homepage and I've been facing an issues that seems like the JS may not be functioning. This is the way that I went about doing so. I ...
1
vote
1answer
213 views

knockout js hiding button text

I am using knockoutjs to send ajax call and successfully am able to do that but when I click on update button the text on button gets to hide. <div class="field-group"> <!-- ko foreach: ...
1
vote
0answers
30 views

Install a BBB js into my pages

I have to install this JS script into my theme (paygo) in the bottom so I think it is the footer. I don't know where to start can someone tell me what to do. <!-- BEGIN: BBB AB Seal --> <...
1
vote
0answers
41 views

Magento Success/Failure Message for the Form Submission using Javascript

I am submitting the form to edit primary shipping and billing addresses via ajax (2 forms, 1 page), and it finally works like it has to. Now, I'd just like to add messages that magento sets for those ...
1
vote
1answer
417 views

Website freezes in checkout on a multistore Magento 2 installation

My default store works perfectly fine. I recently created a second store (each store is accesible through its own domain name) on the same magento installation and I noticed one error/bug in the ...
1
vote
0answers
105 views

Theme without require.js, knockout.js, AngularJS

I'm evaluating a the moment Magento2 as a solution for our Shop and I looked into a lot of Shops based on Magento2 to test the frontend performance and to be honest, I'm shocked. Every Shop I saw ...
1
vote
0answers
30 views

How to Text editor value display product image?

Please see this below image In this, the right has the text editor column and left side to have the product image frame. I need the text area value is display on image frame.how can I write this ...
1
vote
0answers
98 views

Error: Mismatched anonymous define() module error when integrating intl-tel-input with mageto2

I am trying to use https://github.com/jackocnr/intl-tel-input with magento2 on customer registration form for mobile number field to show country flag for choosing phone number but i am getting error "...
1
vote
1answer
588 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 ...
1
vote
1answer
50 views

custom js product page

I'm trying to execute a custom js on a product page in a way to get an color swatch selected on page load only if there is only one option. This is the script: var number = $('.swatch-attribute ....
1
vote
1answer
267 views

Magento 2: can't override js file

I tried to override magento/module-checkout/view/frontend/web/js/view/shipping-address/address-renderer/default.js For this in my custom module i have created under Module/Namespace/view/frontend, ...
1
vote
0answers
37 views

validation script ReferenceError

I got the following error some time on my website and after refreshing the page its work fine... with the validation script ReferenceError: validateOptionsCallback is not defined at eval (eval at ...
1
vote
0answers
26 views

need the CMS path directive for a app/code module folder

i added my own module under /app/code/my/module/ , activated it and put a java script under /app/code/my/module/view/frontend/web/js/myjs/myjs.js it works so far. The javascript is called within a ...
1
vote
0answers
606 views

Magento 1.9.1 I have added popup after clicking on addtocart button but the page is reloading before closing the popup

Magento 1.9.1 I have added popup after clicking on ad to cart button but the page is reloading before before closing the popup, Please let me know how can http://onlineflowersdelivery.com/new/index....
1
vote
0answers
624 views

Magento 2.2.2 - RequireJS domReady! not working with Slick Product Slider

Issue Slick slider breaking/not loading properly on page load and eventually breaking the product slider Solution: Load slick slider script after entire document is loaded and parsed ...
1
vote
0answers
21 views

Updating checkout validations without typing in the field

By default, the validations on checkout fields get updated on "keyup" of the field you're typing in. Is there a way to update validations when clicking a button or by some other action, that is not- ...
1
vote
1answer
120 views

Magento 2 : How to add Js and CSS using php in a page in frontend?

In Magento 2, How to add Js and CSS using php in a page in frontend ? What are the php methods in magento 2 for adding css and js in a page object?
1
vote
1answer
218 views

Magento 2.2.2 Javascript Bundle error

I am currently using Magento 2.2.2 and all is fine with JS bundling and minifying off. However, when I enable js bundling I get a JavaScript error. I think this is related to a require.js config file....
1
vote
0answers
129 views

Magento 2.2 I want to add plyr.js for Vimeo video, I'm getting requirjs error and Class.extend is not a function, how to solve it?

Error 1) Class.extend is not a function. 2)RequireJS Error: Mismatched anonymous define() module: function (_, utils, wrapper) { 'use strict'; 3) I'm getting black screeninsted to Video. ------...
1
vote
1answer
18 views

Split Customer Account edit

i'm trying to split the customer account edit page to 2 column I tried /public_html/vendor/magento/module-customer/view/frontend/layout/customer_account_edit.xml this is my code <page xmlns:xsi="...
1
vote
0answers
40 views

Inserted text via JS is not in POST

I've got a custom backend module. This module has a form created with xml and .phtml file. In form there's some inputs, selects and textarea (the problem). In .phtml file there's only buttons which ...
1
vote
1answer
93 views

M1.9 Jquery issue in CMS page

In my Magento installation I have JQuery 1.10 already included but I need to have a newer version of it. I added the latest version of JQery via the xml update tab in the cms page and I wrote my ...
1
vote
4answers
775 views

Static files - 500 error

I installed fresh Magento but there are no styles or js. Files are in pub folder , but if open in browser I'm getting Internal Server Error. Please help. This is localhost, wamp. Thank you! (I tried ...
1
vote
0answers
65 views

How to get child product _id in magento2?

I can get attribute _color. Now, How to get the selected child product_id in wishlist.js file in Magento2. If anyone knows please help me.
1
vote
0answers
39 views

js 'address' variable in Checkout

Can somebody explain where does 'address' variable come from in i.e file app/code/Magento/Checkout/view/frontend/web/js/view/shipping-information 'address' is used many times as argument into ...
1
vote
0answers
385 views

How to add some custom code javascript in core widget without override

I want to modify mediabrowser widget of magento Location that implement widget in vendor/magento/module-cms/view/adminhtml/templates/browser/content.phtml browser widget stay in lib/web/mage/...
1
vote
1answer
33 views

Minicart -product_sku in Magento 2

Below file contains product_sku value. view/frontend/web/template/minicart/item/default.html file. how to get/use product_sku in custom js file .If anyone knows please explain me
1
vote
1answer
680 views

Uncaught TypeError: Cannot read property 'sectionLoadUrl' of undefined

I am newbie in Web Development. I am working on a Magento ver. 2.1.6. I am getting this error on my every page after loading the page. . How can I solve this error. any help will be appreciated. ...
1
vote
1answer
344 views

Image upload problem in Magento Ver. 1.9.3.7

After upgrading to Magento Ver. 1.9.3.7 image upload to product does not work. Buttons are there, but when I click browse files, or upload image, nothing happens. No file upload form, and no error in ...
1
vote
0answers
104 views

Search through adminhtml grid not working 1.9

Magento ver. 1.9.2.4 Search through admin grids suddenly stopped working. No js files with 404 status, no errors in js console. Script productGridJsObject = new varienGrid(... is present, as it ...
1
vote
1answer
453 views

Callback function for “contentUpdated” event in JS

In Magento 2 we are executing data-mage-init and x-magento-init in dynamic content (ajax response) using using contentUpdated: <script type=“text/x-magento-init”> { "*": { ...
1
vote
1answer
256 views

Magento2 : Theme scripts symlinks not created in developer mode

I'm struggling with an issue for hours now and I really don't get it. I'm using Magento 2.2.1 in developer mode and my scripts symlinks are not created. Here is my project structure --app/ ----...
1
vote
1answer
508 views

How can I add html template to the checkout onepage?

Checkout generate from onepage.phtml file that generate another html page inside like details.html for billing-address and another html file. How can I add new html file to generate inside the onepage....
1
vote
0answers
31 views

Magento 2. Adjust order of loading javascripts

I have the following navigation menu, loaded through Javascript like this: <ul data-mage-init='{"menu":{"responsive":true, "expanded":true, "position":{"my":"left top","at":"left bottom"}}}'> ...
1
vote
1answer
484 views

Magento2 Cant override checkout js file billing-address.js

It seems like a dumb question that was answered a lot here but I cant get it to work. I want to override Magento_Checkout/js/view/billing-address.js the file is physically under module-checkout/view/...
1
vote
1answer
117 views

Call web service from javascript

I could call web service from block with code below : $jsonObject=json_decode(file_get_contents("http://www.testservice.com:50001/Services/Magento.asmx/getPayer?input=".$datasJson)); How can i call ...
1
vote
0answers
381 views

Script in html does not work

I tried to add some javascript in details.html in vendor/magento/module-checkout/view/frontend/web/template/billing-address like in code below. details.html : <div class="billing-address-details" ...
1
vote
1answer
586 views

Magento 2: Frontend file uploader (jquery)

I need my users to be able to upload some files from the backend, with the functionality of a preview image, abort button, multiple files uploadable, etc. And since Magento already uses the blueimp/...
1
vote
1answer
5k views

Blocked a frame with origin from accessing a cross-origin frame

when I want to go onclick to next page's specific div it shows this error . jquery.js:3123 Uncaught DOMException: Failed to read the 'contentDocument' property from 'HTMLIFrameElement': Blocked a ...
1
vote
2answers
823 views

Show div after delay on Magento 2 with JQuery

I need to show this div after 3 seconds on my page. <div id="cratepop"> <br> <center><img src="/shoppingcart.png"></center> <br> </div> ...
1
vote
4answers
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/?...
1
vote
0answers
327 views

Can't submit add-to-cart AJAX form because of duplicated form in mobile friendly product page

I'm working on a mobile design for a Megento product page, what I'm basically doing is duplicating the HTML for desktop and mobile display and showing/hiding the correct design according to the screen ...