Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get link to .css and .js files in tempalte #719

Open
sowinski opened this issue May 29, 2020 · 1 comment
Open

Get link to .css and .js files in tempalte #719

sowinski opened this issue May 29, 2020 · 1 comment

Comments

@sowinski
Copy link

Hi,

I want to load some of my .css files and .js files "lazy". For this purpose I need only the url to the files.

Example
{% javascript 'startpage' %}
returns a <script> tag

But I would like to do something like

var startpage_url = "{% javascript 'startpage' urlonly %}";
// load the script on a specific event (For example user scrolled down)
$(document.head).append($('<script>', { src: startpage_url }));

How can I do this? I guess this is not possible out of the box?

@Pyvonix
Copy link

Pyvonix commented May 29, 2020

Not actually possible. MR #646 is proposed for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants