jQuery错误-调用Struts 2操作时 [英] Jquery Error - While calling Struts 2 action
本文介绍了jQuery错误-调用Struts 2操作时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在从jQuery调用Struts 2动作,就像下面的代码一样.
I'm calling Struts 2 action from jQuery like below code.
jQuery( "#dialog-form" ).dialog({
autoOpen: false,
height: 300,
width: 350,
modal: true,
buttons : {
"Search" : function() {
jQuery.ajax({
type : 'POST',
url : ' <s:submit action="part" method="find" /> '
})
}
}
});
有什么方法可以从jquery调用struts动作吗?
Is there any way to call struts action from jquery ?
推荐答案
使用
jQuery("#dialog-form").dialog({
autoOpen: false,
height: 300,
width: 350,
modal: true,
buttons : {
"Search" : function() {
jQuery.ajax({type : 'POST',
url : '<s:url action="part" method="find"/>'
});
}
}
});
submit tag will not render the url, use url tag instead.
这篇关于jQuery错误-调用Struts 2操作时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文