js window.open 打开新窗体 参数设置
<!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>无标题文档</title>
</head>
<form>
<input type="button" name="Button1" value="CN-Bruce" onclick="WinOpen()" />
<button onclick="window.open('http://www.aspxhome', '', 'width=800,height=300')">open1</button>
<button onclick="var newwin = window.open('http://www.aspxhome', '', 'width=800,height=300'); newwin.moveTo(50, 50), newwin.resizeTo(800, 300)">open2</button>
<button onclick="window.showModelessDialog('http://www.aspxhome', '', 'dialogWidth:800px;dialogHeight:300px')">open3</button>
<a href="#" onclick="window.open('http://www.aspxhome','target','param')">a11</a>
</form>
<body>
</body>
</html>
<!--window.open 参考文档:http://www.cnblogs.com/mfryf/archive/2013/06/10/3130286.html-->
<script language="JavaScript">
function WinOpen() {
//得到页面高度
var yScroll = (document.documentElement.scrollHeight > document.documentElement.clientHeight) ? document.documentElement.scrollHeight : document.documentElement.clientHeight;
//self.resizeBy = yScroll;
//得到页面宽度
var xScroll = (document.documentElement.scrollWidth > document.documentElement.clientWidth) ? document.documentElement.scrollWidth : document.documentElement.scrollWidth;
//self.resizeTo(xScroll - 200, yScroll - 200);
//self.moveTo(xScroll - 200, yScroll - 200);
var x = xScroll - 200;
var y = yScroll - 100;
//mesg = open("http://www.aspxhome", "DisplayWindow", "toolbar=no,,menubar=no,location=no,scrollbars=no");
//mesg.document.write("<HEAD><TITLE>中国asp之家</TITLE></HEAD>");
//mesg.document.write("<CENTER>http://www.aspxhome</CENTER>");
//window.open('http://www.aspxhome', '', 'width="' + x + 'px",height="' + y + '"px');
var featrures = "toolbar=no,menubar=no,location=no,scrollbars=yes,";
var newwin = window.open('http://www.aspxhome', 'target', featrures);
newwin.resizable = "yes";
newwin.moveTo(100, 10);
newwin.moveBy(100, 80);
top = 200
// newwin.resizeTo(x, y);
}
//得到页面高度
var yScroll = (document.documentElement.scrollHeight > document.documentElement.clientHeight) ? document.documentElement.scrollHeight : document.documentElement.clientHeight;
//self.resizeBy = yScroll;
//得到页面宽度
var xScroll = (document.documentElement.scrollWidth > document.documentElement.clientWidth) ? document.documentElement.scrollWidth : document.documentElement.scrollWidth;
//self.resizeTo(xScroll - 200, yScroll - 200);
//self.moveTo(xScroll - 200, yScroll - 200);
</script>
js window.open 打开新窗体 参数设置的更多相关文章
- window.open打开新窗口 参数
1,基本描述 oNewWindow = window.open( sURL , sName , sFeatures, bReplace) window.open在打开一个窗口(其url为sURL)后, ...
- window.open打开新窗体并用post方式传参
function openPostWindow(url,data,name){ //url要跳转到的页面,data要传递的数据,name显示方式(可能任意命名) var tempForm = docu ...
- Response.Redirect 打开新窗体的两种方法
普通情况下,Response.Redirect 方法是在server端进行转向,因此,除非使用 Response.Write("<script>window.location=' ...
- window.open()打开新窗口教程
使用 window 对象的 open() 方法可以打开一个新窗口.用法如下: window.open (URL, name, features, replace) 参数列表如下: URL:可选字符串, ...
- ajax回调打开新窗体防止浏览器拦截有效方法
ajax回调打开新窗体防止浏览器拦截,就这么做! 问题剖析: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 function click_fun(){ window ...
- ajax请求响应中用window.open打开新窗口会被浏览器拦截的解决方式
一.问题描述 ajax 异步请求成功后需要新开窗口打开 url,使用的是 window.open() 方法,但是会被浏览器给拦截了,需要用户点下. 二.问题分析 浏览器之所以拦截新开窗口是因为该操作并 ...
- Window.open()打开一个窗体不被拦截
Window.open()打开一个窗体不被拦截 在DataGrid中建一个模板列,在模板列中放一个客户端的Button,或者直接写你要的字句,然后用<a href>连接例:< ...
- 几个主流浏览器 Window.open打开新窗口 、模拟a标签打开新窗口的 表现
Window.open打开新窗口 1.常用浏览器打开新窗口(正常打开window.open)的的不同表现形式(PC/移动端) 2.Window.open在异步处理中打开(_blank) a标签在异步处 ...
- window.open()打开新窗口 及参数
在jsp页面中需要使用到弹出窗口,想到js的window对象有一个open方法可以弹出窗口,于是对open方法进行记录. 首先是open方法的语法及定义: 定义: open() 方法用于打开一个新的浏 ...
随机推荐
- 读Java面向对象编程(孙卫琴)
2.1创建Java源文件 Java应用由一个或多个扩展名为".java"的文件构成,这些文件被称为Java源文件,从编译的角度,则被称为编译单元. 本章包含两个Java源文件:Do ...
- 当一名黑客获得一份WebShell后,会做什么
当你获得一份webshell后,你会干嘛? 我曾获得N多webshell.什么discuz.dedecms.phpwind.phpweb.aspcms等等,甚至还包括N多自己研发的线上平台. 可是,问 ...
- iOS崩溃调试的使用和技巧总结
在iOS开发调试过程中以及上线之后,程序经常会出现崩溃的问题.简单的崩溃还好说,复杂的崩溃就需要我们通过解析Crash文件来分析了,解析Crash文件在iOS开发中是比较常见的. 现在网上有很多关于解 ...
- Codevs 1230 STL万岁。。 。
题目描述 Description 给出n个正整数,然后有m个询问,每个询问一个整数,询问该整数是否在n个正整数中出现过. 输入描述 Input Description 第一行两个整数 n 和m. 第二 ...
- jquery常用代码
转自:未找到 以下是jquery中比较常用的一些操作实现方式: $("标签名") //取html元素 document.getElementsByTagName("&qu ...
- .NET技术在中国为什么老被人嫌弃
这个话题有点自黑的意思,我从.NET 1.1开始玩.NET,到现在已经11年了,我是看着.NET成长起来,在中国壮大的,也见证了近几年.NET被各种嫌弃,其实说到底还是中国的架构师太少,我是说真正懂行 ...
- Asp.net Mvc中利用ValidationAttribute实现xss过滤
在网站开发中,需要注意的一个问题就是防范XSS攻击,Asp.net mvc中已经自动为我们提供了这个功能.用户提交数据时时,在生成Action参数的过程中asp.net会对用户提交的数据进行验证,一旦 ...
- WPF 3D模型 3D场景
1.首先得说明的是这并不是真正的3D,模型被导出为一系列的单个图片,例如一个3D户型图,以某个视角旋转360°,渲染出一系列连续的单个图片文件. 2.在Image.MouseMove事件中添加相应代码 ...
- HTML5+JS 《五子飞》游戏实现(八)人机对战
要想实现人机对战,就必须让电脑自动下棋,而且要知道自动去查找对方的棋子,看看有没有可以挑一对的,有没有可以夹一个的,这样下起来才有意思. 当电脑用户下完棋后,电脑应立即搜索用户的棋子,然后如果没有被吃 ...
- NetFPGA
From Wikipedia, the free encyclopedia The NetFPGA project[1] is an effort to develop open source har ...