小弟目前正在学jsp
我在jsp中有这样两句 out.println("<script>alert('你已经订购了此商品!');window.close();</script>");
<jsp:forward page="index.html"/>为什么这里对话框不弹出呢,而是直接执行下面的jsp语句。
我在jsp中有这样两句 out.println("<script>alert('你已经订购了此商品!');window.close();</script>");
<jsp:forward page="index.html"/>为什么这里对话框不弹出呢,而是直接执行下面的jsp语句。
解决方案 »
- 请教如何用Intellij和Tomcat,复杂调试JSP
- 银行证书问题
- 怎样快速找到jsp的web程序的数据库用户名和密码
- 高手给讲讲用SQL把行转换成列的思路。。。。。 怎么转的。。!!
- 怎样获取file中的值
- form中的action=""和action="itself.jsp"有什麼區別?
- 使用jfreechart做曲线图时,如何设置x轴和y轴的长度?如何设置纵坐标的初始值,比如我想把起点设置为500,间隔单位为2
- 可以远程访问ODBC数据源吗?
- 如何通过web.xml配置全局参数???
- 从数据库中取得的内容
- There is no Action mapped for action name login
- 请教一个处理mqsql时间查询的问题
<%
out.print("<script>alert('你已经订购了此商品!');window.location.href='index.html';</script>");
%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>My JSP 'MyJsp.jsp' starting page</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
</head>
<body>
This is my JSP page. <br>
<%
out.print("开始执行代码<br/>");
out.print("<script language='javascript'>alert('你已经订购了此商品!');window.location.href='index.html';</script>"); %>
out.print("<br/>结束执行代码");
</body>
</html>