//在js可以这样的到jsp的值
<script type="text/javascript"> var rights='<%=(String)request.getAttribute("rights") %>';
</script> 我现在页面是这样的,想要把jsp变量str赋给js方法//tr是循环
<tr>
<%
String str =..
...
%>
<td>
<html:button property="button" onclick="Insert(<%=str%>)" >
</td>
</tr>
function Insert(str) {
alert(str);
}
请问下,改怎么做?
<html:button property="button" onclick='Insert("<%=str%>")' ><%
String str =..//要对str做处理
str = str.replaceAll("\n","\\n");
str = str.replaceAll("\t","\\t");
str = str.replaceAll("\r","\\r");
...............类似处理.........
...
%>
改成这样onclick="buttonInsert('<%=ins_ID%>'),传过去的值不对(值是:<%=ins_ID%>)