我需要从jsp页面的表中的行中获取值并将其显示在我尝试做的另一个jsp页面的文本框中,但我可以设法调用我的另一个页面但无法获取值从一页到另一页
我的Jquery
$('tr').click(function () {
$('tr').removeClass('selected');
$(this).addClass('selected');
selectedRow = $(this);
});
$("tr").dblclick(function () {
var td = $(selectedRow).children('td');
for (var i = 0; i < td.length; ++i) {
/* alert(i + ': ' + td[i].innerText); */
}
var customer =td[0].innerText
alert('customer :' +customer);
window.location = "InternalConversion.jsp?customer="+customer;
});
JSP页面
<table style="width: 100%;" class="embeddedFIXED" >
<thead>
<tr >
<th align="left">Branch</th>
<th align="left">City</th>
<th align="left">Country</th>
<th align="left">Branch Number</th>
<th align="left">Entity Type</th>
</tr>
</thead>
<tbody>
<%
BranchSearch b1= null;
int rownum = 1;
Iterator<BranchSearch> i = l1.iterator();
while (i.hasNext()) {
b1 = (BranchSearch)i.next();
String rowStyle = "TIRowAlt";
if (rownum % 2 == 0) {
rowStyle = "TIRow";
} else {
rowStyle = "TIRowAlt";
}
%>
<tr class="link1 <%=rowStyle%>" onclick="click()">
<td align="left" class="br" ><%=b1.getBranch()%></td>
<td align="left"><%=b1.getCity()%></td>
<td align="left"><%=b1.getCountry()%></td>
<td align="left"><%=b1.getBranchnumber()%></td>
<td align="left"><%=b1.getEntitytype()%> </td>
</tr>
<%
rownum++;
}
%>
</tbody>
</table>