question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add ability to run scripts per page

See original GitHub issue

Currently 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:closed
  • Created 6 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
joelanmancommented, Apr 13, 2017
0reactions
timpaulcommented, Sep 6, 2017

#373 is merged so closing this now.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found