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.

7
votes
4answers
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
4answers
490 views

I want to translate “Buy” and “save” word in tier_price.phtml file. magento 2

I want to translate "Buy" and "Save" word in tier_price.phtml file.I have added the word in translation csv file but it is not working form me. Refer screenshot PATH : vendor/magento/module-...
1
vote
4answers
1k 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
4answers
384 views

Css and Js not load Magento 2

Problem: I am installing Magento 2 on live server. While the site displays product info and some of the product images, there are no styles and JavaScript functions don't work. Solution attempts/...
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 ...
3
votes
3answers
38 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 ...
2
votes
3answers
33 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 ...
1
vote
3answers
640 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
3answers
927 views

My javascript doesn't run in a custom magento1.9 module

I try to use javascript for a dropdown list I've implemented into a grid as shown in the image. The renderer I use for this dropdown list is like <?php class ...
0
votes
3answers
228 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: ...
0
votes
3answers
216 views

How to add custom js file in Magento 2 in custom theme without use module

I used custom theme in magento 2. I want to add custom js file for navigation in magento 2 but js file not work. I add js link in default_head_block.xml but a js doesn't work. <link src="js/menu....
0
votes
3answers
150 views

Magento 1.x - Custom JS/CSS not found

I added these custom js and css file: skin/frontend/base/default/black/NewsletterPopup/js/main.js skin/frontend/base/default/black/NewsletterPopup/css/main.js Then I included them via my modules ...
0
votes
3answers
453 views

Is it a Trojan? What can I do?

A customer complained about trojan alert on my website, and after doing some reading, I checked the pages, and I found this code below on the System > Configuration > General > Design. <script ...
0
votes
2answers
1k views

Magento 2 checkout knockout.js in custom template error - telephone field

I'm trying to create a mask for telephone field in Magento 2.2.2 checkout. In order to do so. I placed a checkout_index_index.xml with a new template for telephone field at vendor/mytheme/...
0
votes
2answers
621 views

Uncaught TypeError: $el.ColorPicker is not a function Magento 2

Magento ver. 2.0.18 I created a custom module in backend there is color picker options. for this i used this link color picker answer of @EmizenTech it works perfectly but some time it gives and if ...
0
votes
2answers
46 views

Magento 2 : Css and Javascript not loading

I have a big problem with magento, my css and javascript are not loading, I already did: Content deploy; Deleted the static folder but kept the .htacess; but nothing seems to work.
0
votes
2answers
1k 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
2answers
1k 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 ...
0
votes
2answers
554 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 ...
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
2answers
226 views

What does this error mean and how can I solve it?

I have been seeing this error in the console: Uncaught TypeError: Cannot set property 'touchstart' of undefined at String.<anonymous> (jquery.mobile.customized.min.js:10) at Function.each (...
0
votes
2answers
381 views

Magento 2: $.widget is not a function

When I go to the Checkout on 2 different devices, I get different console errors. On a DELL laptop I get the error on domain.com/checkout: $.widget is not a function (dataPost.min.js) Cannot read ...
0
votes
2answers
267 views

Newsletter Popup Submitting But Not Closing

It was working when I first installed it. Now I'm finally ready to try to use it it's not completely working. It Submits the form and it registers in magento backend in the newsletter subscribers but ...
0
votes
2answers
103 views

How to modify text string from this JavaScript file

I would like to change a text string in this file, to be Add or Added to Basket depending on which page the user is on: app/code/Magento/Catalog/view/frontend/web/js/catalog-add-to-cart.js To ...
0
votes
2answers
65 views

How to add +30% to associated simple product price if an attribute = YES?

If configurable product attribute=yes add 30% to associated simple products prices. Have an attribute afiliate in my configurable product. Need to add 30% to the associated simple product price if ...
0
votes
2answers
74 views

CSS and JS not loading

When I run in my terminal: php bin/magento setup:static-content:deploy which is supposed to be the fix for css and js not loading, I get this: PHP Parse error: parse error in /Magento/vendor/...
0
votes
2answers
2k views

Uncaught DOMException: Blocked a Frame with origin from accessing a cross origin-frame

I have a Magento 1.9 site that uses TinyMCE. Everything worked fine until I added a cdn. The script wouldn't load because it was on a different domain. I went ahead and added a subdomain but it still ...
0
votes
2answers
1k 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
2answers
659 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 ...
0
votes
2answers
33 views

How i can get static value with the pound symbol?

I am trying to assign pound value for input box. I am getting error can u please help me? if i give alert means its showing the value but i cant see the input value in inputbox I have tried below code ...