我在表格中有一个姓名列表。当我单击该名称时,它会显示该特定名称下的人员。 例如:
aaa bbb
ccc
现在我想在 aaa 上进行移动,我在工具提示中显示 2(aaa 下的 ppl 数量)。
<a id="tool" title="toolTip" onmouseover="toolTip(localArrGroupNames[<%=in.intValue() %>])">
function toolTip(name){
alert(name);
//can I send this name to a java class ???
}
我在 localArrGroupNames[0] 中获得名称 aaa。但是我无法在 java 类中获得名称,在该类中我计算了 aaa 以下的人数。如何将该值发送到java类?请帮助我。
最佳答案
function toolTip(name){
alert(name);
//can I send this name to a java class ???
new Ajax.Request('jspFile.jsp', {
parameters: {
name: name
},
method: 'get',
onComplete: function(transport) {
var resp = transport.responseText.strip();
$('tool').update(resp);
}
});
}
关于javascript - 将值从 jsp 发送到 java 或 javascript 发送到 java,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7103482/