Saturday, 2 December 2017

Pug/Jade experts: How to use function written in .pug in my .js?

Inside my .pug file, I have for example, at the top something like this- function createStuff() { var parentDiv = document.createElement('
'); var container = document.getElementById('container'); container.appendChild(parentDiv); } How can I export this function so I can use it on client side .js? Instead of writing the example same thing in my .js?Or on a larger scale, if I had a .pug file with all these functions inside, is it possible to export or render them into a .js file I can use on client side?

Submitted December 02, 2017 at 01:46PM by eggtart_prince

No comments:

Post a Comment