Skip to content
Grav 2.1 is out: every page speaks Markdown. Read the announcement →

addInlineJs only works once

Started by finrik 9 years ago · 1 replies · 791 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 FrViPofm, 14 hours ago
1 29 1 hour ago
Themes & Styling · by stuart young, 1 month ago
3 480 1 month ago
Themes & Styling · by Sebadamus, 2 months ago
5 481 2 months ago
Themes & Styling · by martynfoster735, 2 months ago
1 460 2 months ago
Themes & Styling · by Justin Young, 2 months ago
1 490 2 months ago