Quantcast
Viewing all articles
Browse latest Browse all 5

Answer by jprofitt for Adding jQuery to Magento

You can add it in your block files with $this->getLayout()->getBlock('head')->addJs('path/to/jquery.js'); in the _prepareLayout() method

One caveat, Magento uses Prototype, so you'll need to make sure you set jQuery to another variable other than simply $. Adding this to the page made it work for me:

var $j=jQuery.noConflict();

Then you just use $j where you would normally use $


Viewing all articles
Browse latest Browse all 5

Trending Articles