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

Failed To Load Component, Checkout Page (Console Error)

I upgraded Magento from 2.2.1 to 2.3.2, after that when i add any product to cart, on cart page i got these console errors: and when i proceed to Checkout i get more error like these, also i can't ...
1
vote
1answer
4k 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 ...
0
votes
0answers
16 views

Calling MAGENTO API 1.9 using HTML and JAVASCRIPT (experts question - problem) HELP

I need someone who knows MAGENTO and everything related to APIs and REST APIS very well I have a website and I want to validate (check if you want) if the email for a certain customer exist or not ...
3
votes
1answer
2k views

Magento 1.9.1 swatches don't swap images

I've modified my custom template to be able to use swatches with it. (Applied this solution How to use Magento 1.9.1.0 Configurable Swatches in Default package theme (or a custom theme)?) Everything ...
0
votes
0answers
15 views

Validate email using MAGENTO 1.9 (not way)

I've been trying several times to validate an email from my website against MAGENTO without success. I know it is possible to use MAGENTO REST API through JAVASCRIPT or maybe a PHP script but THIS IS ...
7
votes
5answers
2k views

Update price in checkout page without refresh Magento 2

I have a controller where I apply some discount on the checkout page. Now, I can see the price change just after I refresh the page. I search for a solution, to refresh the price using a Js file. ...
1
vote
1answer
22 views

Magento2 : How can i scroll up to first input error validation message on checkout

I saw some simillar questions, but they wanted to remove this feature. They suggested to comment some code in MAGENTO_ROOT/vendor/magento/magento2-base/lib/web/mage/validation.js file if (firstActive....
0
votes
0answers
13 views

keep extend Magento_Ui/js/form/element/wysiwyg but remove component dependency

I just want to extend almost content (not duplicate content to second file). And only remove component 'Magento_Variable/variables'. For reason i don't want to use variables in wysiwyg Is there a way ...
8
votes
4answers
8k 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 ...
0
votes
1answer
49 views

Cannot validate email - MAGENTO api - how

I've been trying without success to validate the email from my website against the MAGENTO customers API and throw a message (exist or not exist) I mean, i have a website where customers are created; ...
1
vote
2answers
33 views

Magento 2.3.X Custom Module JavaScript won't load with require.js

I am building a module, and the HTML loads fine, but the JS isn't. Here is what I have: Vendor Name: NewShop Module Name: HelloWorld File: app/code/NewShop/HelloWorld/view/frontend/requirejs-config....
19
votes
1answer
8k 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 ...
5
votes
5answers
3k views

Magento 2:- How to call a js file on homepage?

I want to call a js file on homepage only how to to do that. Right now i am calling <head><link src="js/myfile.js"/></head> But it is calling for all page and give error js error ...
7
votes
3answers
1k views

SSL Installed Checkout and Account Area Still Using HTTP and not HTTPS

I am running magento 2 ver 2.0.7 I have an HTTPS issue. I'm not quite sure why this is happening but in Stores -> Config -> Web. I have my secure base url set to https://mystore.com/ but when I ...
0
votes
0answers
13 views

JS Bundling causing loading spinner issues in IE11 checkout - Magento 2

Have tried to use Magento 2's JS bundling and am running into a strange error on IE 11 only. When proceeding to the checkout the loading spinner will not disappear. The page seems to load correctly in ...
0
votes
1answer
1k views

Can Not View Content Blocks due to require.js error - Magento 2 theme change

I am facing problem with require.js on Magento 2 theme change Content > Blocks The page shows endless spinner and I can never view my imported blocks for my new theme. When I do Firebug on the page. ...
0
votes
1answer
119 views

Magento 2.2 - Uncaught TypeError: this.modal.zIndex is not a function

Am using Venus need theme, on mini cart's delete click and Checkout's Already have an account? Click here to login throws this issue. Uncaught TypeError: this.modal.zIndex is not a function modal....
1
vote
1answer
208 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....
0
votes
0answers
19 views

Searchbox Stays Open After Upgrade to 2.2.9

Extensions Amasty Advance Search Amasty Elastic Search Elasticsearch 5.1 Apache 2.4 PHP 7.1 The search box in my theme stays opened after I upgraded to Magento Community Edit 2.2.9 and has become ...
1
vote
1answer
4k views

Unable to resolve the source file for error in custom theme?

I am working on magento version 2.1.3 and have a custom theme shoppersbay. For some js files it gives error like Unable to resolve the source file for 'frontend/Smartwave/shoppersbay/en_US/...
0
votes
0answers
8 views

Validation Zip/Code for only “Deutschland” in Magento 1.x

I have a select box like this <div class="input-box"> <select name="billing[country_id]" id="billing-country_id" class="validate-select" title="Land"> <option value=""> &...
2
votes
2answers
11k views

Magento 2: How to defaultly open “content 2” tab?

I am using accordion for tab open and close.How to open default "content 2" tab? <div class="block filter" id="layered-filter-block" data-mage-init='{"collapsible":{"openedState": "active", "...
0
votes
3answers
26 views

Is there any way to reflect the css,js changes without running static content deploy in Magento 2?

Is there any other method other than running deploy command to get new changes in the files in Magento 2?
0
votes
1answer
1k views

Trigger modal after placing a product in minicart on Magento 2

I need to show a modal after a product is placed inside cart. This is what i have so far. This is my default.xml <body> <referenceContainer name="content"> <block ...
0
votes
1answer
27 views

Magento 2.2.9 problem after installing not loading some JS files

After successfully installing Magento 2.2.9 (Windows 10, wamp server) I got the following picture. Does someone know how to solve this? I'm a beginner in Magento. I will be grateful for your answers....
0
votes
3answers
415 views

Failed to load resource: the server responded with a status of 404 (Not Found). How to solve this issue?

I am running Magento 2.3 with NGINX, PHP7.1 and MariaDb. This is a fresh instalation with pre-loaded data. I am getting these follow error: $ tail var/log/system.log [2019-01-09 16:36:24] main.ERROR: ...
3
votes
2answers
2k views

Inserting Javascript codes in one CMS page of Magento 2.1

I am trying to add some javascript codes in one CMS page of a Magento 2.1 site. Here are what I did and the issues I am facing now: 1)at the "Layout Update XML" of the page, add the following jquery ...
0
votes
2answers
588 views

Magento2: Many .js requests. How do I merge js files?

I see over 130 requests to retrieve .js files, and I think it is a reason why the magento2 site is so slow. How can I optimize it? I've already set merge and bundle js files in admin, but it's not ...
1
vote
1answer
19 views

Magento 2 - remove stylesheet and javascript from the home page to improve page load speed

i'm trying to remove some unnecessarily css and javascript that is included in the homepage. For example, the swatches.mini.css, blog-m.min.css, blog-custom.min.css, calendar.min.css doesn't seem to ...
0
votes
0answers
14 views

Strange scroll behavior on mobile device

When I scroll up/down in a mobile browser (Firefox and Safari e.g.) on my iPhone, the scroll stops when the bottom browser menu collapses. I recorded a video to make it more clear. You can see the ...
1
vote
2answers
806 views
1
vote
2answers
683 views

Need to trigger javascript modal on homepage only once

We want to have the registration popup come up on (only) our homepage whenever a customer has not visited before. I think I can chase down the information on setting a cookie for the one-time behavior,...
0
votes
0answers
14 views

Magento 2.X Add external JS snippest not working on checkout page under payment method

I want to add custom JS snippest that display button from third party server. It's like embedded javascript code. I tried to add that source code below the discount code section on the checkout page. ...
1
vote
2answers
606 views

how to trigger click event in M2

In my header section I have user name and if user have access to different location then he has button saying click me. I want to send ajax call on this button. But JS is not working. Can anybody help ...
0
votes
0answers
10 views

How to get the price of this JSON products to be exibihited on my html in a dropdown list?

I have this JSON table that I need to add on my HTML as a dropdown list and when the chosen product is selected, it shows its price and shows a button to simulate a shopping procedure (increase items ...
15
votes
2answers
11k views

When merging CSS or JS, a new file is generated for each page type

We have a lot of small CSS and JS files and enabling merging seems to be a good choice. Many of the CSS and JS files are used on every page (home page, category page, product detail page). Whenever ...
4
votes
1answer
464 views

Magento Go, referencing a JS file attached to a theme in a CMS static block? [closed]

If I want to reference a JS file in a CMS block and the js file has been attached to the theme, how is it done? The CMS block has the script: <script> Galleria.loadTheme('galleria/themes/...
7
votes
5answers
3k views

Exclude custommodule Js from minification of Js in Magento2

I am trying to minify JS in Magento 2. There is an option in the Backend: Stores -> Configuration -> Advanced -> Developer to minify js. I did that and JS got minified but it also includes my custom ...
2
votes
2answers
1k views

Auto Select colour Swatch when configurable product page loads

I have a configurable product with one colour and different sizes, both these are set as required fields. I've set the colour attribute as not required, but then it wont show up when I create a ...
0
votes
1answer
588 views

Magento won't create minified JS files

I switched my Site to production mode and enabled JavaScript minification, bundling and concatenating in the backend, expecting Magento to correctly create the .min.js files - It won't, though. First ...
1
vote
2answers
741 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> ...
0
votes
0answers
11 views

M2 Modal Widget - How to stop video playing after close or click off modal

I have searched for the answer and tried to implement the solutions, and they were not working for me. Everything works fine except the video sound continues to play after closing or clicking off the ...
2
votes
2answers
1k views

How to add JS and CSS calling in PHTML file?

I am including JS validations in Magento, there respected .js and .css files included like: app/design/frontend/Smartwave/porto/Smartwave_Porto/layout/default.xml <css src="Smartwave_Porto::css/...
2
votes
5answers
6k views

Magento2 - cannot load custom css - via default_head_blocks.xml

UPDATE Seems that you cannot inherit Luma.... it works properly when inheriting from blank. github magento source says luma wasn't meant to be inherited. Challenge is, I really like luma, but need ...
0
votes
1answer
12 views

Magento 2: How To Disable Button On Form Submit?

I'm trying to disable button after submitting form, but i'm facing some issue, when i submit black field it validate the form and disable the button... but i want to disable it on form submit ...
4
votes
2answers
5k views

Password Requirements Complexity - Magento

I would like to increase password security for customer and admin accounts in Magento. In addition to minimum password length, contain uppercase, lowercase, special characters, and digits. I found ...
1
vote
1answer
230 views

Magento API calling using HTML and javascript

I'm new to Magento and I'm developing a PhoneGap app using HTML5, CSS and Javascript. I searched many places and read Magento documentations, but couldn't get any example for authenticating, calling, ...
0
votes
1answer
726 views

Magento 2 include google maps js only on contact page

I have a custom theme based on Luma, I'm trying to include google maps script only on contact page but it's not working. Here is my contact_index_index.xml file under my-theme/Magento_Contact/layout/...
0
votes
1answer
31 views

Magento2 : Call custom Js before body closing tag on every page

I have used the below code to call example js file which is located in Magento_Theme folder of the theme. <referenceContainer name="before.body.end"> <block class="Magento\Framework\View\...
0
votes
1answer
35 views

Add Js code for Google measuing checkout in checkout

I want to measure checkout page using tag manager Enhanced Ecommerce. I refered https://developers.google.com/tag-manager/enhanced-ecommerce#checkout. How to add this script. Thanks.