
function winhref()
{
var blankObj = window.open('./add.jsp','_blank','top=100,left=100,width=600,height=300,scrollbars=yes,toolbars=no')
}
window.open ("page.html", "newwindow", "height=100, width=400, toolbar=
no, menubar=no, scrollbars=no, resizable=no, location=no, status=no")
d出窗口是使用的window.open方法
注: window.open方法要在一行中写,不能换行
先执行运算,然后在d出窗口,你可以把这个js代码放到jsp代码的后面,这样就可以实现运算完,再d出窗口了。
扩展资料:JSP中d出对话框的用法实例
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html charset=gb2312" />
<title>三种d出对话框的用法实例</title>
<script language="javascript">
function ale()
{//这个基本没有什么说的,就是d出一个提醒的纯锋对话框
alert("我敢保证,你现在用的是演示一")
}
function firm()
{//利用对话框做缺晌返回的值 (true 或者 false)
if(confirm("你确信要转去 天轰穿的博客?"))
{//如果是true ,那么就把扮羡页面转向thcjp.cnblogs.com
location.href="http://thcjp.cnblogs.com"
}
else
{//否则说明下了,赫赫
alert("你按了取消,那就是返回false")
}
}
function prom()
{
var name=prompt("请输入您的名字","")//将输入的内容赋给变量 name ,
//这里需要注意的是,prompt有两个参数,前面是提示的话,后面是当对话框出来后,在对话框里的默认值
if(name)//如果返回的有内容
{
alert("欢迎您:"+ name)
}
}
思路很简单。卖敬主要中绝慎用到jsp的url传值。查看详情 是一个超链接。比如<a href='a.jsp'>查看详情</a>
a.jsp就是你要d出的窗口页面。
然后怎么把你的id和tpye传到这个页面?
a.jsp?id=1&type=aaa
然后在a.jsp页宏槐面用
String id1= request.getParameter("id")
String type1= request.getParameter("type")
这样 id1和type1就获取到了上一个页面的值。你再去数据库里面查询即可。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)