如何在 Apache 速度中使用 JavaScript 函数?

How to use JavaScript function in Apache velocity?

提问人:rsharma 提问时间:8/17/2023 更新时间:8/17/2023 访问量:24

问:

我有一个预先构建的 JavaScript 函数,我想在速度模板中调用它。我不太了解速度及其语法。我想在我当前的速度模板中使用外部脚本的 JavaScript 函数。

我已经添加了此脚本以包含外部 JS。

<script type="text/javascript" src="../ordertracking.js"></script>

#macro (drawRow)
    
#end

<table id="table-imac-tickets" class="table table-sm table-striped" style="width:100%">
    <thead>
        <tr> 
            <th>Status</th>
        </tr>
    </thead>
    <tbody>  
        #foreach( $r in $ticketlist )  
            <tr>
                <td>
                  // here I want to use functionality of already built JS function that is written inside ordertracking.js file.
                    console.log($!{r.getSolrItem()})
                    #drawRow()
                </td>
            </tr>
        #end
    </tbody>
</table>
JavaScript Apache 速度

评论

0赞 Pointy 8/17/2023
我认为在 Velocity 模板中间运行 JavaScript 没有任何意义。

答: 暂无答案