Add ability to run scripts per page
See original GitHub issueCurrently all scripts are added at the end of the page, in layout.html
.
This means if you have a script on one page that relies on jQuery, there’s no way to add it after jQuery is loaded.
Propose changing this in layout.html
{% block body_end %}
{% include "includes/scripts.html" %}
<!-- GOV.UK Prototype kit {{releaseVersion}} -->
{% endblock %}
to
{% block body_end %}
{% include "includes/scripts.html" %}
{% block page_script %}{% endblock %}
<!-- GOV.UK Prototype kit {{releaseVersion}} -->
{% endblock %}
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Create and run scripts - Configuration Manager - Microsoft Learn
On the Home tab, in the Create group, click Create Script. On the Script page of the Create Script wizard, configure the following...
Read more >Add the capability to execute a custom script before page ...
Add ability to execute any client script in the browser before other page scripts. Here are some use cases: Catch JS errors and...
Read more >How to Easily Add JavaScript in WordPress Pages or Posts
Simply open the page you want the JavaScript to run and note the page ID in the URL. Adding JavaScript to a Specific...
Read more >load and execute order of scripts - Stack Overflow
It doesn't matter whether it's an external script or an inline script - they are executed in the order they are encountered in...
Read more >How to enable execution of PowerShell scripts? - Super User
Start Windows PowerShell with the "Run as Administrator" option. Only members of the Administrators group on the computer can change the ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
cool, thanks, I’ve made a PR: https://github.com/alphagov/govuk_prototype_kit/pull/373
#373 is merged so closing this now.