October CMS resources and help articles

Simple and to the point. Optimized by the community.

Include jQuery in your project

4
by OFFLINE, last modified on August 10th, 2019

You can include the same jQuery version October ships in your theme by using the @jquery alias.

<script src="{{ ['@jquery'] | theme }}"></script>

By passing it as an array to the | theme filter you'll get a new filename as soon as the content of the jQuery file changes. This makes sure that users will download the new version and not use a cached one.

You can also add additional files to the array to combine all of them into a single output file.

<script src="{{ ['@jquery', 'assets/another.js'] | theme }}"></script>

Discussion

0 comments

We use cookies to measure the performance of this website. Do you want to accept these cookies?