使用JSTL调用javascript函数 [英] Call javascript function with if JSTL

查看:114
本文介绍了使用JSTL调用javascript函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以通过JSTL在if内部调用javascript函数?

Is there a way to call a javascript function inside an if with JSTL?

这是代码

<c:choose>
                <c:when test="${orderUploadAction.errors.size()==0}">

                CALL JS FUNCTION HERE

                </c:when>
                <c:otherwise>

                CALL JS FUNCTION HERE

                </c:otherwise>
</c:choose>

推荐答案

尝试一下

<c:choose>
  <c:when test="${orderUploadAction.errors.size()==0}">
     <script> yourFunctionName() </script>
  </c:when>
  <c:otherwise>
     <script> yourAnotherFunctionName() </script>
  </c:otherwise>
</c:choose>

这篇关于使用JSTL调用javascript函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆