Skip to content
Grav 2.0 is officially stable. Read the announcement →
Themes & Styling

addInlineJs only works once

Started by finrik 8 years ago · 1 replies · 699 views
8 years ago

I have a very strange problem.

Javascript code should be inserted inside the page. So i do:

TWIG
{% set script %}
  ... some JS Code...
{% endset %}
{% do assets.addInlineJs(script,{ 'group':'bottom','priority':100 }) %}

and
{{ assets.js('bottom') }}

The first time I load the page everything works perfectly. But, if I click on F5 to reload the page, the JS code is no longer available.

But why???

Thank you very much!

8 years ago

Okay, I found out it's related with the caching. If I turn off caching, it works.
But that can't be the solution. ;)

Suggested topics

Topic Participants Replies Views Activity
Themes & Styling · by Justin Young, 2 weeks ago
1 164 2 weeks ago
Themes & Styling · by Slebeig, 1 month ago
4 288 1 month ago
Themes & Styling · by Pedro M, 3 months ago
4 614 3 months ago
Themes & Styling · by Ian, 3 months ago
3 320 3 months ago
Themes & Styling · by Norbert, 2 years ago
11 745 4 months ago