在得到不同对象间的操
1,开始的时候我们使用:AJAX
<script type="text/javascript">
$(document).ready(function(){
$("#tb tbody tr:odd").addClass("bgcolor");
$(".showNat").each(function() {
var id = $(this).attr("id");
//alert(id);
htmlobj=$.ajax({url:"<%=basePath%>admin/qrc/getNat?nid="+id,async:false});
$(this).html(htmlobj.responseText);
});
$(".showPnat").each(function() {
var id = $(this).attr("id");
//alert(id);
htmlobj=$.ajax({url:"<%=basePath%>admin/qrc/getPnat?nid="+id,async : false});
$(this).html(htmlobj.responseText);
});
});
</script>
2,后来我们使用了action标签
<td>
<s:action name="showr" executeResult="true">
<s:param name="rolearr" value="roleidarr" ></s:param>
</s:action>
</td>
3,后来我们直接使用action的方法
<td><s:property value="getParentNative(nid)"/></td> <td><s:property value="getNative(nid)"/></td>
总结:
第三种最为简单,但要在qrc的action中注入nativeService
第二种需要一个返回的的页面作为中介
第一种,在客户端不断向服务器发送请求,显然很慢,而且需要中转页面
浙公网安备 33010602011771号