Jump to content

load a javascript file in the header


Recommended Posts

Hello,

 

I have external javascript file named mod.js. Need to add in header.tpl how i can that? how to AddJS to load a javascript file in the header?

 

put directly this code to header.tpl

<script type="text/javascript" src="/themes/prestashop/js/mod.js"></script>

 

or anything else?

Link to comment
Share on other sites

  • 2 weeks later...
  • 4 months later...
  • 4 weeks later...
  • 1 year later...

<script type="text/javascript" src="{$js_dir}mod.js"></script> this one will work upload your javascript file in js directory folder themes/themename/js/ then insert the script below {$HOOK_HEADER}

 

Best option ;), THANKS

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...