<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>是否</title>
<script type="text/javascript" language="javascript">
function sure()
{
if(confirm("是否继续添加员工资料")){
<jsp:forward page="/index.jsp"/>
}else{
location.href="fdfaf.jsp";
}
}
</script> </head><body onLoad="sure()">
</body>
</html>为什么不会出现确认框就直接转向 index.jsp;
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>是否</title>
<script type="text/javascript" language="javascript">
function sure()
{
if(confirm("是否继续添加员工资料")){
<jsp:forward page="/index.jsp"/>
}else{
location.href="fdfaf.jsp";
}
}
</script> </head><body onLoad="sure()">
</body>
</html>为什么不会出现确认框就直接转向 index.jsp;
可以直接<括号这样写么,而且句尾没有分号然后你先把<jsp:forward page="/index.jsp"/>换成是alert("OK!")试试看能不能出确认框
<script type="text/javascript" language="javascript">
function sure()
{
if(confirm("是否继续添加员工资料")){
location.href="index.jsp";
}else{
location.href="fdfaf.jsp";
}
}
</script>
<jsp:forward />这个标签怎么可以在javascript标签<script></script>使用;
你这样写本身就是一个很大的低级错误的。
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=GBK" />
<title>是否</title>
<script type="text/javascript" language="javascript">
function sure()
{
if(confirm("是否继续添加员工资料")){ location.href="reg.jsp";
}else{
location.href="index.jsp";
}
}
</script> </head><body onload="sure()">
</body>
</html>
request.setAttribute("empId", empdg);
return "success";
谢谢各位,但我在Action的值就不能用request传给要index.jsp,reg.jsp了?