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.

Related tags:

  • for questions related to the native Prototype JS library of Magento.
  • for questions related to the use of the jQuery library in Magento.
  • for questions related to the native Magento 2 Require JS library.
2376 questions
4
votes
0 answers

Launch Polyfill.io BEFORE Magento 2 scripts

I need to use the https://polyfill.io/v2/docs/ library for a Magento 2 project, so I called it in : htdocs/app/design/frontend/my_theme/default/Magento_Theme/layout/default_head_blocks.xml With this code :
Balix
  • 81
  • 3
3
votes
1 answer

Magento - Defer Parsing of Combined Javascript File

How would I defer parsing of Javascript in magento on a combined JS file? In System --> Configuration, I have it set so that all JS files are combined into one file. I found a solution on another thread, which is to use the "defer" keyword on the…
3
votes
2 answers

How to add external JS to CMS Page

I'm trying to add an external javascript file to a CMS page using the Layout Update XML feature, and have had no luck. I have tried the following
John Quinones
  • 33
  • 1
  • 3
3
votes
2 answers

jQuery conflict - newbie

Installed a search extension and now the shopping cart is broken. Am getting a javascript error. When the extension is disabled everything works fine. The Extension support told me to empty their .js file. But that does not fix the issue. I don't…
Wesley
  • 31
  • 1
  • 2
3
votes
2 answers

How can you remove or add JS to the theme based on criteria?

I tried adding the code to template/page/html/head.phtml if (Mage::helper('mobiledetect')->isMobile()){ $this->addItem('js', 'js/mobile_jsscript.js'); $this->getLayout()->getBlock('head')->removeItem('js', 'js/normal_js_script.js'); } Is this…
tread
  • 1,083
  • 2
  • 13
  • 36
3
votes
1 answer

Magento customer registration not saving selected state/region

So for some reason my Magento install (1.5) stopped saving new customers state/region name, both inside admin and outside. Magento's registration form has a dropdown select, with a name of "region_id" and a hidden text field named "region". I guess…
localhost
  • 131
  • 2
  • 12
2
votes
1 answer

Magento media/js folder filled up with 500kb js files each minute

Our magento/media/js folder is being populated with js files sometimes 4-6 times a minute. We just checked and there were 10Gb worth of files in there. Cron only runs each 5 minutes. We have turned off our FPC, our CDN and looked everywhere. No idea…
Kim K.
  • 73
  • 8
2
votes
1 answer

Problem with Javascript on Product View Page

I've installed the Ultimo theme and it works great but there is a javascript error on the product view page which effects the dropdown navigation, image zoom and tabs for the product description, reviews etc,etc. I have no idea how to debug the…
handcoded
  • 33
  • 1
  • 5
1
vote
1 answer

Basic question: How to add javascript functionality to a page?

I hope this site is friendly to beginner questions. I would like to add some javascript for sitewide effect. Specifically, I want to make it so that when you scroll down a page, certain elements (e.g. the Category nav, and the Filter bar which I…
Buttle Butkus
  • 1,318
  • 1
  • 16
  • 35
1
vote
1 answer

Adroll Conversion Tracking Enterprise 1.9

These are the instructions. I have put the code in the success file but its not passing any order values back to Adroll. Confirm that your AdRoll SmartPixel is placed in the Miscellaneous HTML section in your Magento Admin Panel. In the folder…
1
vote
1 answer

Which JavaScript file is used on page Customer -> Addresses?

On the following page: Customers -> Manage Customers -> Click on a customer -> Addresses If there are 2 or more addresses, you can click on an address and the address appears in the "Edit Customer's Address" box. I can tell this is done in…
Mex
  • 386
  • 1
  • 6
  • 16
1
vote
2 answers

Pop out window not working

I use to have a message displaying if the customer is not over the free delivery amount just to see if they want to top their cart up to get free delivery. This is the code i am using and i want it to pop out of the screen but instead it is just…
Adam Allen
  • 2,205
  • 7
  • 37
  • 68
1
vote
1 answer

Hide first 8 digits using substr() in Magento credit card information

how to hide first 8 digits in following code using substr(): $data[Mage::helper('payment')->__('Credit Card Number')] = sprintf('xxxx-%s', $this->getInfo()->getNumber()); As I'm new to JS, please edit the code and post here Thanks a lot in…
Baby in Magento
  • 3,167
  • 16
  • 83
  • 221
1
vote
2 answers

Jquery prototype conflict IE7 and 9 already using noConflict()

I am using noConflict() function within a template page on a Magento site and I'm pretty sure my code is in the correct order on the following page (view page source): http://animalnecessity.com/company/where-to-buy. The script is working on all…
CaitlinHavener
  • 779
  • 2
  • 20
  • 42
1
2 3