admin管理员组文章数量:1126302
Yesterday I learned about the prerender function in html. I was glad that such a thing exists, because in my current project a couple of pages do not load fast enough. But I ran into a problem. My project is written in spring boot using thymeleaf and I have dynamic links that open pages by id:
<a th:href=“@{/form/edit/{id}(id=${id_back})}”><button>previous</button></a>
<a th:href=“@{/form/edit/{id}(id=${id_next})}”><button>next</button></a>
Do you know a way to put this same function inside a pre-render script?
Maybe it's possible to do it somehow like this?
<script type="speculationrules">
{
"prerender": [
{
"urls": [th:href=“@{/form/edit/{id}(id=${id_back})}”, th:href=“@{/form/edit/{id}(id=${id_next})}”]
}
]
}
</script>
Here is documentation about this feature:
本文标签: javascriptPrerendering dynamic links using htmlStack Overflow
版权声明:本文标题:javascript - Pre-rendering dynamic links using html - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736641400a1946001.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论