Search code examples
expressionengine

How to embed a javascript/jquery file in ExpressionEngine?


I need to embed jquery files in ExpressionEngine.

I have created the template js under the main site template group.

I know that the css is embedding with the following tag:

<link rel="stylesheet" href="{stylesheet=template_group/template}" type="text/css" media="screen" />

for css its {stylesheet=template_group/template}

I want to know what is the tag for embedding js files

<script src=" [-->> ?? <<--] " type="text/javascript"></script>

Solution

  • Just make sure that your template containing your javascript is of the "JavaScript" type, and link it using the standard path syntax:

    <script src="{path="scripts/myscript"}" type="text/javascript"></script>