Magento Forum

   
How do I add something before the </html> tag? 
 
the311guy
Sr. Member
 
Avatar
Total Posts:  120
Joined:  2007-10-18
 

I need to add a javascript before the end html and after the end body tag, where can I do this?

</body> here </html>

 
Magento Community Magento Community
Magento Community
Magento Community
 
nikefido
Guru
 
Avatar
Total Posts:  481
Joined:  2008-07-11
New Haven, CT
 

If you’re adding a google analytics snippet, there’s a built in function in the admin area to do this for you.

Otherwise, create a static block in your CMS with the javascript snippet and add it into the page.xml layout file (might have to search the boards here for the proper way to do that).

This might help you also:

http://www.exploremagento.com/magento/editing-the-footer-in-a-stock-magento-build.php

 
Magento Community Magento Community
Magento Community
Magento Community
 
nikefido
Guru
 
Avatar
Total Posts:  481
Joined:  2008-07-11
New Haven, CT
 

Also, your javascript snippet should go before the </body> not after it.

I’m not sure if this will affect anything, but i’ve never seen javascript between the </body> and </html> tags.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
    Back to top