Mercurial > hg > nginx-site
view xsls/banner.xsls @ 2994:537b98ec3c83
Development guide: fixed example code.
The code produced compiler errors.
author | Roman Arutyunyan <arut@nginx.com> |
---|---|
date | Thu, 17 Aug 2023 20:31:29 +0400 |
parents | fdf1464e1977 |
children |
line wrap: on
line source
<!-- Copyright (C) Nginx, Inc. --> X:stylesheet { X:var BANNER = "'/banner/banner.html'"; X:template banner_link () { X:if "substring-after($DIRNAME, '/')" { !{ concat($ROOT, $BANNER) } } else { !{ substring-after($BANNER, '/') } } } X:template banner () { <script> window.addEventListener("load", function(e) \{ fetch("!banner_link ()") .then((response) => response.text()) .then((resp) => \{ document.getElementById("banner").innerHTML = resp; \}) .catch((error) => \{ console.warn(error); \}); \}); </script> } }