Project

General

Profile

Feature #97652 » f_asset-js-inplace.html

Include js and have it rendered at the position it is included wihtin the fluid template. - Jan Loderhose, 2022-05-20 10:02

 
<!--
Inlude js and have it rendered at the position it is included wihtin the fluid template.
-->

<!--
/* some-animation.js BEGIN */
//animate something
/* some-animation.js END */
-->

<!--
/* ViewHelper BEGIN */
...
<div class="some-placeholder-for-animation">
...
</div>
<f:asset.script identifier="example" href="/path-to/example.js" inline="true" inplace="true" />
...
/* ViewHelper END */
-->

<!-- RESULT -->
<!DOCTYPE html>
<html>
<head></head>
<body>
...
<div class="some-placeholder-for-animation">
...
</div>
<!--
The example uses a file which is rendered inline as an example but the inplace attribute could as well be used for externally included files
and inline JS which was written inline by hand.
-->
<script>
//animate something
</script>
...
</body>
</html>
(6-6/6)