我认为,您需要调整服务器端代码以处理Ajax发布请求以发送邮件并
dojo.xhrPost在用户单击按钮时使用方法。您的JS代码可能如下所示:
function sendMailHandler(evt, item) { dojo.xhrPost({ url: "/2_8_2012/jsp/SendMailReminder.jsp", content: { 'SendMail': item }, error: function() { alert("Sent failure"); }, load: function(result) { alert("Email sent with result: " + result); } }); dojo.stopEvent(evt); } function sendmail(item) { return "<button onclick='sendMailHandler(arguments[0], "" + item + "")'>Send Mail</button>"; }请注意,
dojo.stopEvent(evt);in
sendMailHandler用于停止事件冒泡并防止
RowClick引发事件。
也
dojo.xhrGet有类似的语法来执行ajax GET请求,您可以使用它代替jQuery
$.get。您也可以在我的示例中使用,
dojo.xhrGet而不是使用
dojo.xhrPost它,因为它有可能无需调整就可以与您的后端一起使用,但是
POST(或ajax表单提交)在语义上会更正确。
关于“试图注册一个id =“ something”,您应该调整代码以避免ID重复,或者显示导致错误的代码。



