Forum Discussion

lc-garcia's avatar
11 years ago

Adding a Javascript snippet

Hi all,

 

What's your advice on the best place to add a 10 line Javascript snippet? Should that be a separate file? Can that be added to an existing one?

 

Gracias,

Luis

  • Depends what its for really? The theme wrappers include a hitbox area for analytics tracking for example, you might consider putting it here. Or it could be included and uploaded to html/assets. 

  • HaidongG's avatar
    HaidongG
    Lithium Alumni (Retired)

    agree with cblown , it really depends what is the JavaScript usage. you can add it with hitbox, skin wrappers directly or upload to html/assets with a reference from skin wrapper.

    • lc-garcia's avatar
      lc-garcia
      Guide

      It's just a piece of code that selects an option for a dropdown as default.

      Thanks for your reply

      • lc-garcia's avatar
        lc-garcia
        Guide

        Hi guys,

         

        I think I'm ready with my research here. What I endep doing is using a Custom Content module with some Javascript specific to the type of page I was looking for. 

         

        Gracias,

        Luis