Skip to content
● Meet Grav Guard: keep every Grav site you run secure and up to date, all from one place. Free for up to 3 sites. Read more →

addInlineJs only works once

Started by finrik 9 years ago · 1 replies · 907 views
9 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!

9 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 MarkP, 1 week ago
3 127 3 days ago
Themes & Styling · by TomW, 7 days ago
0 69 7 days ago
Themes & Styling · by themetman, 2 weeks ago
1 162 2 weeks ago
Themes & Styling · by AH, 4 weeks ago
1 278 2 weeks ago
Themes & Styling · by Bruno, 4 years ago
6 1467 2 weeks ago