功能。
在网页上放一个按钮。按了之后。执行一个action。这个action返回一个页面,这个页面显示在我原来的页面当中。
这个网页直接替换掉我原来页面中的某个div。书上写着。
利用
<s:head theme="ajax"/>
…………
<s:form theme="ajax" action="abc">
<s:submit targets="XXXX">
</s:form><div id="XXXX">
</div>但是我现在用的是struts2.2.3.百度之后说,这个版本的struts取消了<s:head theme="ajax"/>标签,theme属性无法赋值ajax。请问现在怎样可以实现?谢谢。希望详细代码。
在网页上放一个按钮。按了之后。执行一个action。这个action返回一个页面,这个页面显示在我原来的页面当中。
这个网页直接替换掉我原来页面中的某个div。书上写着。
利用
<s:head theme="ajax"/>
…………
<s:form theme="ajax" action="abc">
<s:submit targets="XXXX">
</s:form><div id="XXXX">
</div>但是我现在用的是struts2.2.3.百度之后说,这个版本的struts取消了<s:head theme="ajax"/>标签,theme属性无法赋值ajax。请问现在怎样可以实现?谢谢。希望详细代码。
再引入jQuery,然后写JS函数:
<script type="text/javascript">
function commit() {
$.ajax({
type: "POST",
url: "abc.action",
data: "参数名=参数值",//如果没有参数的话,就不要这一项。
success: function(msg){
$("#XXXX").html(msg);
}
});
}
</script>