繁体   English   中英

如果JSTL调用javascript函数

[英]Call javascript function with if JSTL

有没有办法在使用JSTL的if中调用javascript函数?

这是代码

<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>

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM