django-pipeline icon indicating copy to clipboard operation
django-pipeline copied to clipboard

Get link to .css and .js files in tempalte

Open sowinski opened this issue 4 years ago • 1 comments

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

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?

sowinski avatar May 29 '20 10:05 sowinski

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

Pyvonix avatar May 29 '20 15:05 Pyvonix