jsp onclick如何传递string参数 15
<html><head><script>functionupdatestatus(str){alert(str);}functiondeletecompany(str1)...
<html>
<head>
<script>
function updatestatus(str){
alert(str);
}
function deletecompany(str1){
alert(str1)
//window.location.href="deletecompany.jsp?cid="+str1;
}
</script>
</head>
<body>
<%
String status=request.getParameter("status");
//String id=request.getParameter("id");
String id="0005";
out.println(id);
if(status.equals("approve")){
out.println("<input type='button' value='update' onclick='updatestatus(\""+id+"\")'/>");
}else if(status.equals("reject")){
out.println("<input type='button' value='delete' onclick='deletecompany(id)'/>");
}
%>
</body>
</html>这是我的代码
就是两种按钮点击都没响应,也没报错,试了几种fuction里的参数格式,都没用,求教 展开
<head>
<script>
function updatestatus(str){
alert(str);
}
function deletecompany(str1){
alert(str1)
//window.location.href="deletecompany.jsp?cid="+str1;
}
</script>
</head>
<body>
<%
String status=request.getParameter("status");
//String id=request.getParameter("id");
String id="0005";
out.println(id);
if(status.equals("approve")){
out.println("<input type='button' value='update' onclick='updatestatus(\""+id+"\")'/>");
}else if(status.equals("reject")){
out.println("<input type='button' value='delete' onclick='deletecompany(id)'/>");
}
%>
</body>
</html>这是我的代码
就是两种按钮点击都没响应,也没报错,试了几种fuction里的参数格式,都没用,求教 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询