Window.location = "aaa.aspx"
Die obige Methode kann nur auf der aktuellen Seite geöffnet werden.
Form.Target = "_ leer";
Form.Action = "aaa.aspx";
Form.Submit ();
window.top.location = url kann aktualisiert und im übergeordneten Fenster geöffnet werden.
Die Methode für das Fenster. Open ist reich an Stil. Es gibt einen Nachteil, um das Fenster zu verwenden. Open in JS, dass es leicht vom Browser blockiert werden kann. In diesem Artikel werden verschiedene Methoden eingeführt, um das neue Fenster in JS zu öffnen.
1. Öffnen Sie den ganzen Bildschirm eines neuen Fensters
Kopieren Sie den Code -Code wie folgt:
<html> <kopf>
<title> blau </title>
<Script>
Funktion ow (owurl) {
var tmp = window.open ("über: leer", "", "fullscreen = 1")
tmp.moveto (0,0);
Tmp.resizeto (screen.width+20, screen.height);
tmp.focus ();
tmp.location = owurl;
}
</Script>
</head>
<body>
<Ahref = "JavaScript: OW ('http://www.aspxhome.com/');">
Blog </a>
2. Öffnen Sie die feste Größe des neuen Fensters
Kopieren Sie den Code -Code wie folgt:
<Buttonclick = "window.open ('/rot/', '', 'width = 800, Höhe = 300')"> Open1 </button>
<button onclight = "varNewwin = window.open ('/rot/'); newwin.moveto (50,50); newwin.resizeto (800,300)"> open2 </button>
<ButononClight = "window.showmodelessDialog ('/rot', '', 'Dialogwidth: 800px; DialogHeight: 300px')"> Öffnen3 </button>
3. Öffnen Sie die Standardgröße
Kopieren Sie den Code -Code wie folgt:
<Script>
// tmtc_winmaximizer
if (document.layers) {
var larg = screen.availwidth-10;
var altez = screen.availHeight-20;}
anders {
var larg = screen.availwidth-2;
var altez = screen.availHeight;}
Self.Resizeto (larg, Altez);
Self.moveto (0,0);
// tmtc_winmaximanerend
</script>
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - -
<criptuanguage = "javaScript">
<!-
Self.moveto (0,0)
Self.Resizeto (screen.availwidth, screen.availHeight)
//->
</script>
4. Öffnen Sie es normal und öffnen Sie ein Pop -up -Fenster
Kopieren Sie den Code -Code wie folgt:
<criptuanguage = "javaScript">
Funktion winopen () {
Mesg = open ("cnrose", "displayWindow", "Symbolleiste = no, MenuuBar = no, local = no, scrollbars = no");
mesg.document.write (<gead> <title> Chinese ASP House </title> </head> ");
mesg.document.write ("<Enter> http: //www.aspxhome </center>");
}
</script>
<form>
<Eingabe type = "button" name = "button1" value = "cn-bruce" onclick = "winopen ()">
</form>
---------------------------------------------- -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------
<A href =#onclick = window.open ('http: //www.aspxhome', 'target', 'param')> a </a>
5. Chromloses Fenster für IE6 SP1
Kopieren Sie den Code -Code wie folgt:
<Html xmlns: IE>
<meta http-äquiv = "content-type" content = "text/html; charset = gb2312">
<Ie: download id = "include" style = "verhalten: url (#Standard#download)" /> />
<title> chromelessWindow </title>
<Scriptuanguage = "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; Farbe: Schwarz; Border: 2Pxoutset; Border-Style: Expression_R (onmouseout = onmouseUp = function () {this.style.borderSyle = 'Outset'}, Onmousedown = function () {if (Ereignis (Ereignis) (Ereignis (Ereignis) (Ereignis .Button! ";";
// Fenster erstellen
Incluse.StartDownload (cw_url, function (source) {content = source});
Funktion Insert_content () {
var test = "" ;;
Cw_body.style.overflow = "Hidden";
Cw_body.style.backgroundcolor = "White";
Cw_body.style.border = "Solid Black 1px";
Content = content
Temp += "<Tabellenbreite = 100% Höhe = 100% CellPadding = 0Cellspacing = 0 Grenze = 0>" ";
temp += "<trStyle = '; Schriftgröße: 12px; Hintergrund:#0099cc; Höhe: 20; Cursor: default'ondblClick =/" max.innertext ==' 1 '?' Parent.if_max =! Return false'oncontextMenu = 'return false'> "";
Temp += "<tdstyle = 'color: #ffffff; padding-heft: 5px'> chromelessWindow für IE6 sp1 </td>" ";
Temp += "<tdStyle = 'Farbe: #ffffff; Padding-Light: 5px;' Align = Right>";
Temp += "<span id = help onclick =/" alert ('chromelessWindow für IE6 sp1 -ver 1.0 // ncode von windy_sk // n // nspecialthans für und "style =/" "" "" "" " +" +" +" CSSTTEXT+ "Schriftfamilie: System; Padding-Light: 2px;/">?
Temp+= "<spanid = min = 'parent.new_cw.hide (); parent.blur ()' style =/"+cstetext+"Schriftfamilie: Webdings;/" title = 'minimum'> 0 </span> " ;
Temp += "<spanid = max onclick =/" this.inNertext = this.inNertext == '1'? '2': '1'; "Style =/"+csstText+"Schriftfamilie: Webdings;/" title = 'maximum'> 1 </span> "";
Temp+= "<span id = closeonclick = 'parent.opner = null; parent x </span> "" ";
temp += "</td> </tr> <tr> <tdcolspan = 2>" ";
Temp+= "<div id = includeyle = 'Überlauf: Scroll; Überlauf-x: versteckt; Überlauf-y: auto; Höhe: 100%; Breite:"+cwidth+"'" "";
temp += Inhalt;
temp += "</div>";
temp += "</td> </tr> </table>" ";
Cw_body.innerhtml = temp;
}
setTimeout ("insert_content ()", 1000);
var if_max = true;
Funktion show_cw () {
Fenster.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";
}
} Anders {
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;
// Fenster verschieben
var Drag_x, Drag_y, DRAGING = False
Funktion drag_move (e) {
if (DRAGING) {
New_cw.show (e.Screen-drag_x, e.Screeny-drag_y, cw_width, cw_height);
False zurückgeben;
}
}
Funktion Drag_down (e) {
if (e.button == 2) return;
if (new_cw.document.body.offsetwidth == screen.width && new_cw.document
Drag_x = e.clientX;
Drag_y = e.clienty;
DRAGING = TRUE;
e.srcelement.setCapture ();
}
Funktion Drag_Up (e) {
DRAGING = falsch;
e.srcelement.releasecapture ();
if (new_cw.document.body.offsetwidth == screen.width && new_cw.document
CW_TOP = E.Screen-Drag_x;
Cw_left = e.Screeny-drag_y;
}
</Script>
</Html>
6 Öffnen Sie den Vollbild
Kopieren Sie den Code -Code wie folgt:
<html>
<kopf>
<meta http-äquiv = "content-type" content = "text/html; charset = gb2312">
<title> JS -Methode zur Öffnung der neuen Fenstercodesammlung - China ASP Home - http: //www.aspxhome </title>
<link href = "index.css" rel = "stylesheet" type = "text/css">
<script Language = "javaScript" Typ = "text/javaScript">
<!-
Funktion machakfull (dh andere) {
x = screen.availwidth;
y = screen.availHeight;
Target = Parseflot (Navigator.Appversion.Substring (Navigator.Appversion.Indexof ('.')-1, Navigator.Length));););
If ((navigator.appversion.indexof ("mac")! = -1) && (navigator.userages.indexof ("msie")!
Window.open (andere, "sub", 'scrollbars = yes');
if (Ziel> = 4) {
if (if (navigator.appname == "netscape") {{{{{{
varmachakfull = window.open (andere, "machakfull", 'scrollbars = yes', 'width ='+x+', Höhe ='+y+', top = 0, links = 0');
Machakfull.moveto (0,0);
Machakfull.resizeto (x, y);}
if (Navigator.Appname == "Microsoft Internet Explorer"))
Window.open (dh "machakfull", "fullscreen = yes");
}
sonst window.open (andere, "sub", 'scrollbars = yes');
}
Funktion mm_gotourl () {//v3.0
var i, args = mm_gotourl.arguments;
für (i = 0; i <(args.Length-); i+= 2) eval_r (args [i]+". location = '"+args [i+1]+"'");
}
//->
</script>
</head>
<body bgcolor = "#3366cc" scroll = noonload = "machakfull ('/bbs/', '')">
---------------------------------------------- -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------
<Script>
Window.open ('/', '', 'fullscreen = 1');
Fenster.CLOSE ();
</script>
7, Webdialogfeld
Kopieren Sie den Code -Code wie folgt:
<Script>
window.onload = function () {
varFeatures = 'Status: 0; Dialogwidth: 470px; DialogHeight: 470px; DialogTop: 100px; Dialogleft: 100px; ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: : ::::::::::::::::::::::3
showModelessDialog ("http: //www.aspxhome/", Fenster, Funktionen);
}
Funktionshow (Laasn)
{{{{
var obj;
obj = laysn.style;
obj.visibility = 'sichtbar';
}
Funktion versteckt (Laysn)
{{{{
var obj;
obj = laysn.style;
obj.visibility = 'versteckt';
}
</script>
8. Das untergeordnete Fenster öffnet und schließt das übergeordnete Fenster
Kopieren Sie den Code -Code wie folgt:
<Script>
Window.open ('http://www.aspxhome.com/'.'width=790, Höhe = 590');
Window.opner = null;
Fenster.CLOSE ();
</script>