1. 程式人生 > >struts2標籤與js配合使用

struts2標籤與js配合使用

<s:iterator value="#request.list" id="set">  
     <s:set name="pageId" value="%{#set.id}"></s:set>  
     <s:set id="pageInfo" name="pageInfo" value="%{#set.info}"></s:set>  

     <s:if test="#pageId=='31'">  
          <script type="text/javascript">  
               var
info= '<s:property value="pageInfo"/>'; $(function(){ $.post(info,"", function(data){$("#div3_1").html(data);}); });
</script> </s:if> <s:if test="#pageId=='32'"> <script type="text/javascript"
>
var info= '<s:property value="pageInfo"/>'; $(function(){ $.post(info,"", function(data){$("#div3_2").html(data);}); }); </script> </s:if> <s:else> <script type="text/javascript"
>
var info= '<s:property value="pageInfo"/>'; $(function(){ $.post(info,"", function(data){$("#div3_3").html(data);}); }); </script> </s:else> </s:iterator>