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