//关闭,父窗口弹出对话框,子窗口直接关闭
this.Response.Write("<script language=javascript>window.close();</script>");

//关闭,父窗口和子窗口都不弹出对话框,直接关闭
this.Response.Write("<script>");
this.Response.Write("{top.opener =null;top.close();}");
this.Response.Write("</script>");

//弹出窗口刷新当前页面width=200 height=200菜单。菜单栏,工具条,地址栏,状态栏全没有
this.Response.Write("<script language=javascript>window.open('rows.aspx','newwindow','width=200,height=200')</script>");

//弹出窗口刷新当前页面
this.Response.Write("<script language=javascript>window.open('rows.aspx')</script>");
this.Response.Write("<script>window.open('WebForm2.aspx','_blank');</script>");

//弹出提示窗口跳到webform2.aspx页(在一个IE窗口中)
this.Response.Write(" <script language=javascript>alert('注册成功');window.window.location.href='WebForm2.aspx';</script> ");

//关闭当前子窗口,刷新父窗口
this.Response.Write("<script>window.opener.location.href=window.opener.location.href;window.close();</script>");
this.Response.Write("<script>window.opener.location.replace(window.opener.document.referrer);window.close();</script>");

//子窗口刷新父窗口
this.Response.Write("<script>window.opener.location.href=window.opener.location.href;</script>");
this.Response.Write("<script>window.opener.location.href='WebForm1.aspx';</script>");

//弹出提示窗口.确定后弹出子窗口(WebForm2.aspx)
this.Response.Write("<script language='javascript'>alert('发表成功!');window.open('WebForm2.aspx')</script>");

//弹出提示窗口,确定后,刷新父窗口
this.Response.Write("<script>alert('发表成功!');window.opener.location.href=window.opener.location.href;</script>");

//弹出相同的一页
<INPUT type="button" value="Button" οnclick="JavaScript:window.open(window.location.href)">

//
Response.Write("parent.mainFrameBottom.location.href='yourwebform.aspx?temp=" +str+"';");

<SCRIPT LANGUAGE="JavaScript">
<!--
window.open ('page.html', 'newwindow', 'height=100, width=400, top=0, left=0, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=n o, status=no') //这句要写成一行
-->
</SCRIPT>

参数解释:

<SCRIPT LANGUAGE="JavaScript"> js脚本开始;
window.open 弹出新窗口的命令;
'page.html' 弹出窗口的文件名;
'newwindow' 弹出窗口的名字(不是文件名),非必须,可用空''代替;
height=100 窗口高度;
width=400 窗口宽度;
top=0 窗口距离屏幕上方的象素值;
left=0 窗口距离屏幕左侧的象素值;
toolbar=no 是否显示工具栏,yes为显示;
menubar,scrollbars 表示菜单栏和滚动栏。
resizable=no 是否允许改变窗口大小,yes为允许;
location=no 是否显示地址栏,yes为允许;
status=no 是否显示状态栏内的信息(通常是文件已经打开),yes为允许;
</SCRIPT> js脚本结束

'newwin':隐藏菜单栏地址栏工具条
width=50:宽度
height=50:高度
scrollbars=yes/no:滚动条
top=50:窗口距离屏幕上方
left=50:窗口距离屏幕左侧
例:window.open('detail.aspx?ID="+e.Item.Cells[1].Text+"','newwin','width=750,height=600,scrollbars=yes,top=50,left=50');");
this.Response.Write("<Script>window.open('WebForm2.aspx','','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,width=750,height=470,left=80,top=40');</script>");

例:
this.Response.Write("<script>alert('发表成功!');window.opener.location.href=window.opener.location.href;</script>");
this.Response.Write("<script>");
this.Response.Write("{top.opener =null;top.close();}");
this.Response.Write("</script>");

例: linkcolumn1.DataNavigateUrlFormatString="JavaScript:varwin=window.open('edit_usr.aspx?actid={0}','newwin','width=750,height=600,scrollbars=yes,top=50,left=50');window.close()";

this.Response.Write("<Script>window.open('WebForm7.aspx','','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,width=750,height=470,left=80,top=40');</script>");

弹出跟你当前的窗口有没有菜单工具栏没有关系,你只要在页面中写一个脚本它就弹出了.比如
<a href=# οnclick="window.open('xxx.aspx','窗口名称','参数');">xxxxx</a>

以下列出一些弹出窗口的参数,你可自行设定,参数之间用逗号分隔

可选。字符串--列出对象表并用逗号分开。每一项都有自己的值,他们将被分开(如:"fullscreen=yes, toolbar=yes")。下面是被支持的各种特性。 
channelmode = { yes | no | 1 | 0 } 是否在窗口中显示阶梯模式。默认为no。
directories = { yes | no | 1 | 0 } 是否在窗口中显示各种按钮。默认为yes。
fullscreen = { yes | no | 1 | 0 } 是否用全屏方式显示浏览器。默认为no。使用这一特性时需要非常小心。因为这一属性可能会隐藏浏览器的标题栏和菜单,你必须提供一个按钮或者其他提示来帮助使用者关闭这一浏览窗口。ALT+F4可以关闭窗口。一个全屏窗口必须使用阶梯(channelmode)模式。
height = number 指定窗口的高度,单位是像素。最小值是100。
left = number 指定窗口距左边框的距离,单位是像素。值必须大于或者等于0。
location = { yes | no | 1 | 0 } 指定是否在窗口中显示地址栏。默认为yes。
menubar = { yes | no | 1 | 0 } 指定是否在窗口中显示菜单栏。默认为yes。
resizable = { yes | no | 1 | 0 } 指定是否在窗口中显示可供用户调整大小的句柄。默认为yes。
scrollbars = { yes | no | 1 | 0 } 指定是否在窗口中显示横向或者纵向滚动条。默认为yes。
status = { yes | no | 1 | 0 } 指定是否在窗口中显示状态栏。默认为yes。
titlebar = { yes | no | 1 | 0 } 指定是否在窗口中显示标题栏。在非调用HTML Application或者一个对话框的情况下,这一项将被忽略。默认为yes。
toolbar = { yes | no | 1 | 0 } 指定是否在窗口中显示工具栏,包括如前进、后退、停止等按钮。默认为yes。
top = number 指定窗口顶部的位置,单位是像素。值必须大于或者等于0。
width = number 指定窗口的宽度,单位是像素。最小值是100。

转载于:https://www.cnblogs.com/hubcarl/archive/2009/06/25/1510789.html

javascript弹出对话框相关推荐

  1. 分享:JavaScript弹出对话框的三种方式

    转载自品略图书馆 http://www.pinlue.com/article/2019/11/2023/069810461833.html 学习过js的小伙伴会发现,我们在一些实例中用到了alert( ...

  2. javascript 弹出对话框

    首先我想先说两句我对javascript的一些看法,我希望大家认真的去学习这门编程语言,因为它给我们在开发网页时,会带来很多的惊喜!javascript一般是运行在客户端的(client),主要用于开 ...

  3. JavaScript弹出对话框的三种方式

    转自:微点阅读  https://www.weidianyuedu.com 学习过js的小伙伴会发现,我们在一些实例中用到了alert()方法.prompt()方法.prompt()方法,他们都是在屏 ...

  4. JavaScript弹出对话框的三种方法

    三种方法 alert(); 最简单,将alert();括号内的内容弹出. confirm(); 与alert();类似,包含确认和取消按钮,点击确定confirm();方法会返回true,点击取消co ...

  5. JavaScript弹出对话框的三种方式-alert()-confirm()-prompt()

    一.alert()警告框(确定) alert()方法是显示一条弹出提示消息和确认按钮的警告框. 需要注意的是 : alert()是一个阻塞的函数,如果不点确认按钮,后面的内容就不会加载出来. 使用方式 ...

  6. Javascript弹出对话框 确定取消转到不同页面

    代码如下,请根据情况作适当修改 <script language="javascript"> function delit() { result="确认要删除 ...

  7. javascript如何弹出对话框

    javascript弹出对话框 1.消息框 页面上操作完成后弹出个信息框,提示操作成功的方法: Response.Write("<mce:script type="text/ ...

  8. java fx alert_javaFx:使用弹出对话框 Alert

    javaFx8 自带的对话框非常好用,类似的使用方式如下: /** * 弹出一个通用的确定对话框 * @param p_header 对话框的信息标题 * @param p_message 对话框的信 ...

  9. JSP 弹出对话框的方式总结

    JSP 网页在与用户交互的过程中,有时需要弹出提示框,通知用户一些信息,如登录密码错误等 在做JSP网页项目中, 实践并总结了三种有效的方式 方式1: JSP前端 <scripttype=&qu ...

最新文章

  1. Visual Studio工具栏中无法选择调试设备
  2. String insert()总结
  3. java 抽象类 方法_java 抽象类
  4. 一个网站大概多少钱_建一个外贸网站大概需要多少钱?角点科技总结建外贸网站的费用...
  5. linux计划任务没有运行,linux下定时任务不能执行
  6. 联系人存储ContactsProvider表分析
  7. matlab生成39码,LaTeX技巧357:MATLAB如何直接生成latex代码?
  8. (01)ORB-SLAM2源码无死角解析-(18) SVD奇异值分解→求解Homography,Fundamental矩阵,了解矩阵自由度
  9. wps序号打乱重新排序_wps表格 已经排好序号 ,顺序错误,想重新排列
  10. lumerical FDTD自学日记
  11. 学习日记——Quartus工程创建与运行
  12. 接入技术——长途呼叫的典型路由
  13. 经典游戏江湖医馆文字版
  14. Java HashMap面试须知
  15. TTL RGB信号相关 介绍最为详细 HSYNC VSYNC DE CLK
  16. 30 张图,概览 CPU 制作全过程
  17. 贵州小县城出身的“网约车品牌”,如何拓县出省、走向全国?
  18. 三态内容寻址存储器(TCAM)概念
  19. 【调剂】大连民族大学2020年硕士研究生招生调剂公告
  20. creo打不开stp文件_Creo怎么打开stp格式的文件?

热门文章

  1. | 应用打包还是测试团队老大难问题?
  2. 从一个叫灵异拼图(the forgotten) 影片看东西方文化的差异
  3. 移动端开发之Web App开发
  4. valist:解决变参问题
  5. PM的基石(1) - PMP (国际项目管理师)
  6. InstallShield自定义对话框浅谈(转)
  7. [html] 写一个鼠标跟随的特效
  8. Djongo框架+Vue问题总结
  9. VIL-SLAM论文翻译:Stereo Visual Inertial LiDAR Simultaneous Localization and Mapping
  10. IP数据包的路由转发