代码
<tr index='<%=i%>' style='cursor:hand;' onmouseout='javascript:mouseout(this)' onmouseover='javascript:mouseover(this)' onClick='javascript:ClickCheck("<%=rs.getString2(1)%>+_+<%=rs.getString2(2)%>")'>
<td width="5%" class="table-firstline">
<input type="radio" name="selectId" value="<%=rs.getString2(1)%>+_+<%=rs.getString2(2)%>">
</td>
<td width="25%" class="table-firstline"><h5><%=rs.getString2(1)%></h5></td>
<td width="65%" class="table-firstline"><h5><%=rs.getString2(2)%></h5></td>

</tr>以上代码中,ClickCheck后面的参数,和<input type="radio" name="selectId" value 的参数应该是一样的,都是<%=rs.getString2(1)%>+_+<%=rs.getString2(2)%> ,但是最终运行结果却不一样,查看了生成的网页代码,如下:
<tr index='49' style='cursor:hand;' onmouseout='javascript:mouseout(this)' onmouseover='javascript:mouseover(this)' onClick='javascript:ClickCheck("52")'>
<td width="5%" class="table-firstline">
<input type="radio" name="selectId" value="52+_+Mr. Bahram">
</td>
<td width="25%" class="table-firstline"><h5>52</h5></td>
<td width="65%" class="table-firstline"><h5>Mr. Bahram</h5></td>

</tr>
不明白为何会产生不一样的结果?

解决方案 »

  1.   

    现在是能获得参数了,刚才是缓存没清掉,但是还是发了语法错误,如果就正常:
    <tr index='<%=i%>' style='cursor:hand;'  onClick='javascript:ClickCheck("<%=rs.getString2(1)%>")'>
    但如下就不正常,提示"未结束的字符串常量"
    <tr index='<%=i%>' style='cursor:hand;'  onClick='javascript:ClickCheck("<%=rs.getString2(1)%>+_+<%=rs.getString2(2)%>")'>但是这个却可以:
    <input type="radio" name="selectId" value="<%=rs.getString2(1)%>+_+<%=rs.getString2(2)%>">我这个是jsp网页的代码