<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里的参数格式,都没用,求教
ä¸è¬<a>æ ç¾ä¸ä¼ä½¿ç¨hrefåonclick两ç§æ¹å¼æ¥è¿è¡è¿è¡é¡µé¢è·³è½¬ææ§è¡å¨ä½ï¼ä½æ¯ä¸è¬é½ä¼ä½¿ç¨onclickæ¥è¿è¡æ§è¡Ajaxå½æ°è¿è¡è·³è½¬ï¼å¹¶åæ¶ä½¿ç¨onclick="xxxxxx(this)"æ¥ä¼ éå¨æåæ°ï¼ä¾åå¦ä¸
JSP代ç å¦ä¸ï¼
Js代ç å¦ä¸ï¼
ä¸è¬ä¼å°hrefå为âjavascript:void(0)â èä¸æ¯â#âï¼å 为å¯ä»¥é²æ¢ä¸å¿
è¦ç页é¢è·³å¨ï¼
èthisæçå°±æ¯aæ ç¾è¿ä¸ªå¯¹è±¡