Ich benutze EJS als Template-Engine und frage mich, wie ich ein Skript einfügen würde, das nur auf einer Seite am Ende des Seitenlayouts benötigt wird.EJS enthalten Skript am Anfang/Ende des Seitenlayouts
Beispiel:
Layout:
<head>
//Scripts and stuff
</head>
<body>
<article>
<%-body%> // Render page here
</article>
</body>
Seite:
//This script needs to go within the head of the layout
//Or before the closing </body> tag in the layout, but only
//when this particular page is loaded.
<script src="onlyRequiredOnThisPageWithinTheLayout.js"></script>
<p>Page content</p>
Dank!