Ulrich Krause
Ulrich Krause

Reputation: 1111

Loading CSJS in a theme?

I added a new client-side JS lib (typeAheadDemo.js) to my theme recently, but the lib is not loading and so the functions in the lib are not available in the application. It works with other elements ( CSS, JS from URL ). So I wonder, if there is any known issue with loading client-side JS in a theme. I cleared the browser cache and also restarted the server. But the lib is not loaded. If I add the lib as a resource to the page, everything is working fine. I also tried with and without the leading slash.

enter image description here

Upvotes: 0

Views: 158

Answers (1)

Thomas Adrian
Thomas Adrian

Reputation: 3636

This is the way I reference javascript located in the "Code\Script Libraries"

<resource>
        <content-type>application/x-javascript</content-type>
        <href>typeAheadDemo.js</href>
</resource>

Hope it helps

Upvotes: 1

Related Questions