1

i am trying to remove the validation.js script from my home page as it is not need here. I am using this code in my page.xml

    <cms_index_index>
    <reference name="head">
                <action method="removeItem"><script>prototype/validation.js</script></action>
    </reference>
</cms_index_index>

But the script is still being loaded. What am i doing wrong?

Thanks

1 Answer 1

2

Try like this:

<cms_index_index>
    <reference name="head">
       <action method="removeItem">
           <type>js</type>
           <script>prototype/validation.js</script>
       </action>
    </reference>
</cms_index_index>

The removeItem method receives 2 parameters. The type of the resource and the name of the resource. You were missing the type.

3
  • It works! I new it would be something simple! thanks, will accept answer when it lets me
    – Adam Allen
    Commented Mar 4, 2015 at 11:44
  • To remove a CSS file would i just change type to css and script to stylesheet?
    – Adam Allen
    Commented Mar 4, 2015 at 11:51
  • Yep. Just change the type to skin_css
    – Marius
    Commented Mar 4, 2015 at 11:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.