Yesod - 如何让 addScriptRemote 在 head 部分添加脚本?

Yesod - how to make addScriptRemote add the script in the head section?

在 Yesod/Haskell 中,我想调用 addScriptRemote 并让它在头部部分添加 <script> 标记。照原样,它似乎只将脚本添加到正文部分。

放置脚本的位置将取决于 jsLoader。如果要对特定脚本进行更改,可以使用 toWidgetHead [hamlet|<script src=...">|].