Search This Blog

Friday, 18 May 2012

Add or Remove Javascripts for specific page in Magento

To Remove JS file:

Layout XML Head reference:
<action method="removeItem"><type>js</type><name>calendar/calendar.js</name></action>

OR

Block Class PHP:
$this->getLayout->getBlock('head')->removeItem('js', 'calendar/calendar.js');

To Add JS file:
$this->getLayout->getBlock('head')->addjs('abc/cdf.js');

No comments:

Post a Comment