Window.location = "aaa.aspx"
El método anterior solo se puede abrir en la página actual.
form.target = "_ en blanco";
form.action = "aaa.aspx";
form.subMit ();
Window.top.location = URL se puede actualizar y abrir en la ventana principal.
El método de ventana. Hay una desventaja para usar la ventana. Abra en JS de que es fácil ser bloqueado por el navegador. Este artículo presenta varios métodos para abrir la nueva ventana en JS.
1. Abra la pantalla completa de una nueva ventana
Copiar código del código de la siguiente manera:
<html> <cead>
<title> azul </title>
<script>
Función ow (owurl) {
var tmp = window.open ("Acerca de: en blanco", "", "FullScreen = 1")
tmp.moveto (0,0);
Tmp.resizeto (Screen.Width+20, Screen.Height);
tmp.focus ();
tmp.location = owurl;
}
</script>
</ablo>
<Body>
<ahref = "javascript: ow ('http://www.aspxhome.com/');">
Blog </a>
2. Abra el tamaño fijo de la nueva ventana
Copiar código del código de la siguiente manera:
<ButtonClick = "Window.open ('/Red/', '', 'Width = 800, Height = 300')"> Open1 </Button>
<botón onClight = "varnewwin = window.open ('/rojo/'); newwin.moveto (50,50); newwin.resizeto (800,300)"> Open2 </boton>
<butononclight = "window.showModelessDialog ('/rojo', '', 'Dialogwidth: 800px; dialogHeight: 300px')"> Open3 </Button>
3. Abra el tamaño predeterminado
Copiar código del código de la siguiente manera:
<script>
// tmtc_winmaximizer
if (document.layers) {
var larg = screen.availwidth-10;
var Altez = Screen.availheight-20;}
demás {
var larg = screen.availwidth-2;
var Altez = Screen.availheight;}
Self.resizeto (Larg, Altez);
Self.moveto (0,0);
// tmtc_winmaximanerend
</script>
-------------------------------------------------- -------------------------------------------------- -------------------------------------------------- -
<scriptLanguage = "javaScript">
<!-
Self.moveto (0,0)
Self.resizeto (Screen.availwidth, screen.availheight)
//->
</script>
4. Abre normalmente y abre una ventana pop -up
Copiar código del código de la siguiente manera:
<scriptLanguage = "javaScript">
Función winopen () {
Mesg = Open ("Cnrose", "DisplayWindow", "Barra de herramientas = no, Menubar = no, local = no, ScrollBars = no");
Mesg.document.write (<gead> <title> China ASP House </title> </head> ");
mesg.document.write ("<Enter> http: //www.aspxhome </center>");
}
</script>
<form>
<input type = "button" name = "button1" value = "cn-bruce" onClick = "winopen ()">
</form>
-------------------------------------------------- -------------------------------------------------- -------------------------------------------------- -------------------------------------------------
<A href =#onclick = window.open ('http: //www.aspxhome', 'target', 'param')> a </a>
5. Ventana sin croma para IE6 SP1
Copiar código del código de la siguiente manera:
<Html xmlns: es decir>
<meta http-oquiv = "content-type" content = "text/html; charset = gb2312">
<IE: Descargar id = "incluir" estilo = "comportamiento: url (#predeterminado#descargar)" /> />
<title> ChromelessWindow </title>
<ScriptLanguage = "jscript">
var cw_width = 400;
var cw_height = 300;
var cw_top = 100;
var cw_left = 100;
var cw_url = "http://www.cnbruce.com/bluebook/";
var new_cw = window.createPopup ();
var cw_body = new_cw.document.body;
var content = "";
Var cssttext = "margin: 1px; color: negro; border: 2pxoutset; border-style: expresion_r (onMouseOut = onMouseUp = function () {this.style.borderStyle = 'outset'}, onmousEdown = function () {if (event (event (event .Button! ";";
// Ventana de construcción
Incluir.startdoDload (cw_url, function (fuente) {content = fuente});
función insert_content () {
VAR test = "" ;;
Cw_body.style.overflow = "Hidden";
Cw_body.style.backgroundcolor = "White";
Cw_body.style.border = "Solid Black 1px";
Content = content.replace (/<a ([^>]*)>/g, "<aonclick = 'parent.open (this.href); return false' $ 1>");
TEMP += "<width de tabla = 100% altura = 100% CellPadding = 0CellSpacing = 0 border = 0>" ";
temp += "<trstyle = '; font-size: 12px; fondo:#0099cc; altura: 20; cursor: default'ondblClick =/" max.inntext ==' 1 '?' Parent.if_max =! Return false'onContextMenu = 'return false'> "";
Temp += "<tdstyle = 'color: #ffffff; padding-heft: 5px'> ChromelessWindow para IE6 SP1 </td>" ";
Temp += "<tdstyle = 'color: #ffffff; padding-right: 5px;'
Temp += "<span id = help onClick =/" alert ('ChromelessWindow para IE6 Sp1 -ver 1.0 // ncode por windy_sk // n // nspecialthans for and "style =" "" "" "" " + CSSTText+ "Font-Family: System; Padding-Right: 2px;/">? </span>;
Temp+= "<spanId = min = 'parent.new_cw.hide (); parent.blur ()' style =/"+cstetext+"Font-Family: webdings;/" title = 'mínimo'> 0 </span> " ;
Temp += "<spanid = max onClick =/" this.inntext = this.inntext == '1' '2': '1'; "Style =/"+cssttext+"Font-Family: webdings;/" title = 'Maximum'> 1 </span> "";
TEMP+= "<SPAN ID = CloseOnClick = 'Parent.opner = null; parent.close ()' style =/"+cssttext+"Font-Family: System; Padding-Right: 2px;/" "Title = 'Close'> x </span> "" ";
temp += "</td> </tr> <tr> <tdcolspan = 2>" ";
Temp+= "<div id = includeStyle = 'Overflow: Scroll; Overflow-X: Hidden; Overflow-Y: Auto; Altura: 100%; Ancho:"+CWidth+"'" "";
temp += contenido;
temp += "</div>";
temp += "</td> </tr> </table>" ";
Cw_body.innerhtml = temp;
}
setTimeOut ("insert_content ()", 1000);
var if_max = true;
función show_cw () {
Window.moveto (10000, 10000);
if_max) {
New_cw.show (cw_top, cw_left, cw_width, cw_height);
ifof (new_cw.document.ling.include)!
New_cw.document.all.include.style.width = cw_width;
New_cw.document.all.max.innertext = "1";
}
} Demás {
New_cw.show (0, 0, Screen.Width, Screen.head);
New_cw.document.all.include.style.width = screen.width;
}
}
Window.Onfocus = show_cw;
window.onresize = show_cw;
// Mover la ventana
var drag_x, drag_y, draging = false
Función drag_move (e) {
if (draging) {
New_cw.show (E.Screen-Drag_X, E.Screeny-Drag_Y, CW_WIDTH, CW_HEight);
Devolver falso;
}
}
Función drag_down (e) {
if (e.button == 2) return;
if (new_cw.document.body.offsetwidth == screen.width && new_cw.document.offsetheight == Screen.Height)
drag_x = e.clientx;
drag_y = e.clienty;
Draging = True;
E.SrCelement.SetCapture ();
}
función drag_up (e) {
Draging = falso;
E.SrCelement.RelEASECapTure ();
if (new_cw.document.body.offsetwidth == screen.width && new_cw.document.offsetheight == Screen.Height)
Cw_top = E.Screen-Drag_X;
Cw_left = e.screeny-drag_y;
}
</script>
</Html>
6, abra la pantalla completa
Copiar código del código de la siguiente manera:
<html>
<Evista>
<meta http-oquiv = "content-type" content = "text/html; charset = gb2312">
<title> JS Método para abrir una nueva colección de código de ventana - China ASP Home - http: //www.aspxhome </title>
<link href = "index.css" rel = "stylesheet" type = "text/css">
<script language = "javaScript" type = "text/javaScript">
<!-
Function machakfull (es decir, otro) {
x = screen.availwidth;
y = screen.availheight;
Target = parseflot (navigator.appversion.substring (navigator.appversion.indexof ('.')-1, navegator.length));););
If ((navigator.appversion.indexof ("mac")! = -1) && (navigator.userages.indexof ("msie")! = -1) && (parseint (navigator.appversion)))
Window.open (otro, "sub", 'scrollbars = yes');
if (target> = 4) {
if (if (navigator.appname == "netscape") {{
varmachakfull = window.open (otros, "machakfull", 'scrollbars = yes', 'width ='+x+', altura ='+y+', top = 0, izquierda = 0');
Machakfull.moveto (0,0);
Machakfull.resizeto (x, y);}
if (navigator.appname == "Microsoft Internet Explorer")
Window.open (es decir, "machakfull", "fullscreen = yes");
}
else window.open (otro, "sub", 'scrollbars = yes');
}
Función mm_gotourl () {//v3.0
var i, args = mm_gotourl.arguments;
para (i = 0; i <(args.length-); i+= 2) eval_r (args [i]+". ubicación = '"+args [i+1]+"'");
}
//->
</script>
</ablo>
<Body bgcolor = "#3366cc" scroll = noonload = "machakfull ('/bbs/', '')">
-------------------------------------------------- -------------------------------------------------- -------------------------------------------------- -------------------------------------------------
<script>
Window.open ('/', '', 'FullScreen = 1');
window.close ();
</script>
7, cuadro de diálogo web
Copiar código del código de la siguiente manera:
<script>
window.onload = function () {
varFeatures = 'Status: 0; Dialogwidth: 470px; dialogHeight: 470px; diálogo: 100px; dialogleft: 100px; resizable: 0; desplazamiento: 0; centro: 1';
showModelessDialog ("http: //www.aspxhome/", ventana, características);
}
FUNCIÓN SHOW (LAASN)
{{
var obj;
obj = Laysn.Style;
obj.visibility = 'visible';
}
Función oculta (Laysn)
{{
var obj;
obj = Laysn.Style;
obj.visibility = 'Hidden';
}
</script>
8. La ventana infantil abre y cierra la ventana principal
Copiar código del código de la siguiente manera:
<script>
Window.open ('http://www.aspxhome.com/','width=790, altura = 590');
Window.opner = nulo;
window.close ();
</script>