Window.Location = "aaa.aspx"
O método acima só pode ser aberto na página atual.
form.target = "_ em branco";
form.action = "aaa.aspx";
form.subMit ();
Window.top.Location = URL pode ser aberto na janela dos pais na página no iframe
O método Window.Open é rico em estilo. Há uma desvantagem para usar a janela. Open no js que é fácil ser bloqueado pelo navegador. Este artigo apresenta vários métodos para abrir a nova janela em JS.
1. Abra a tela completa de uma nova janela
Copie o código do código da seguinte forma:
<html> <head>
<title> azul </title>
<Cript>
Função ow (owurl) {
var tmp = window.open ("Sobre: Blank", "", "tela cheia = 1")
tmp.moveto (0,0);
Tmp.resizeto (screen.width+20, screen.height);
tmp.focus ();
tmp.Location = Owurl;
}
</Script>
</head>
<Body>
<href = "javascript: ow ('http://www.aspxhome.com/');">
blog </a>
2. Abra o tamanho fixo da nova janela
Copie o código do código da seguinte forma:
<ButtonClick = "window.open ('/vermelho/', '', 'largura = 800, altura = 300')"> Open1 </button>
<button onclight = "varnewwin = window.open ('/red/'); newwin.moveto (50,50); newwin.resizeto (800.300)"> open2 </button>
<butononclight = "window.showmodelessdialog ('/vermelho', '', 'diálogo de diálogo: 800px; dialogHeight: 300px')"> open3 </button>
3. Abra o tamanho padrão
Copie o código do código da seguinte forma:
<Cript>
// tmtc_winmaximizer
if (document.layers) {
var larg = screen.availwidth-10;
var altez = screen.availHeight-20;}
outro {
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. Abra normalmente e abra uma janela pop -up
Copie o código do código da seguinte forma:
<scriptLanguage = "javascript">
Função winopen () {
Mesg = aberto ("cnrose", "displaywindow", "barra de ferramentas = não, menubar = não, local = não, scrollbars = não");
Mesg.document.write (<Gead> <title> House ASP chinês </ititle> </head> ");
Mesg.document.write ("<Enter> http: //www.aspxhome </central>");
}
</script>
<morm>
<input type = "button" name = "button1" value = "cn-Bruce" onclick = "winopen ()">
</morm>
--------------------------------------------------- -------------------------------------------------------- -------------------------------------------------------- ---------------------------------------------------
<a href =#onclick = window.open ('http: //www.aspxhome' ,'target'.'param ')> a </a>
5.
Copie o código do código da seguinte forma:
<Html xmlns: ie>
<meta http-equiv = "content-type" content = "text/html; charset = gb2312">
<Ie: download id = "incluir" style = "comportamento: url (#padrão#download)" /> />
<title> ChromelessWindow </ititle>
<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 csStext = "margem: 1px; cor: preto; borda: 2pxoutSet; estilo de borda: expressão_r (onmouseout = onMouseUp = function () {this.style.borderstyle = 'tender'}, onmousedown = function () {if (evento .butão! = 2) ";";
// Janela de construção
Incluir.startDownload (cw_url, function (origem) {content = origem});
função 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); retorna false' $ 1>");
Temp += "<largura da tabela = 100% de altura = 100% CellPadding = 0Cellspacing = 0 borda = 0>" ";
temp += "<trstyle = '; tamanho da fonte: 12px; fundo:#0099cc; altura: 20; cursor: default'ondblClick =/" max.innerText ==' 1 '?' 2 ':': 1 '; Parent.if_max =! Return false'onOnContextMenu = 'return false'> "";
Temp += "<tdstyle = 'cor: #ffffff; preenchimento-heft: 5px'> ChromlessWindow para ie6 sp1 </td>" ";
Temp += "<tdstyle = 'cor: #fffff; preenchimento de preenchimento: 5px;' alinhe = direita>" ;;
Temp += "<span id = help OnClick =/" alert ('ChromlessWindow para ie6 sp1 -ver 1.0 // ncode por windy_sk // n // pecialthans para e "estilo =/" "" "" "" "" + CSSTTEXT+ "Font-Family: System; Padding-Right: 2px;/">?
Temp+= "<spanid = min = 'parent.new_cw.hide (); parent.blur ()' estilo =/"+cstetext+"Font-family: webdings;/" title = 'Minimum'> 0 </span> " ;
Temp += "Spanid = Max OnClick =/" This.innerText = This.innerText == '1'? "Style =/"+csstText+"Font-família: webdings;/" title = 'maximum'> 1 </span> "";
Temp+= "<span id = closeOnClick = 'parent.opner = null; parent.close ()' style =/"+csstText+"font-family: System; preenchimento: 2px;/" "title = 'feche'>> x </span> "" ";
temp += "</td> </tr> <tr> <tdcolspan = 2>" ";
Temp+= "<div id = incluir estilyle = 'transbordamento: rolagem; overflow-x: hidden; overflow-y: auto; altura: 100%; largura:"+cwidth+"'" "" ";
temp += content;
temp += "</div>";
temp += "</td> </tr> </ table>" ";
Cw_body.innerhtml = temp;
}
setTimeout ("insert_content ()", 1000);
var if_max = true;
função show_cw () {
window.moveto (10000, 10000);
if (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";
}
} Outro {
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;
// mova a janela
var drag_x, drag_y, Draging = false
função drag_move (e) {
if (Draging) {
New_cw.show (e.screen-drag_x, e.screeny-drag_y, cw_width, cw_height);
Retornar falso;
}
}
Função drag_down (e) {
if (e.button == 2) retornar;
if (new_cw.document.body.offsetWidth == screen.width && new_cw.document.body.offsethEight == Screen.Height) return;
drag_x = e.clientX;
drag_y = e.clienty;
Draging = true;
e.srcelement.setcapture ();
}
função drag_up (e) {
arrastando = false;
E.SrCELEMENT.RELEASECAPTURA ();
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 a tela inteira
Copie o código do código da seguinte forma:
<html>
<head>
<meta http-equiv = "content-type" content = "text/html; charset = gb2312">
Método <título> JS para abrir a nova coleção de código de janelas - China Asp Home - http: //www.aspxhome </ititle>
<link href = "index.css" rel = "Stylesheet" type = "text/css">
<Script Language = "Javascript" type = "text/javascript">
<!-
Função Machakfull (ou seja, outros) {
x = screen.availwidth;
y = screen.availHeight;
Target = Parsefllot (Navigator.AppVersion.Substring (Navigator.AppVersion.IndexOf ('.')-1, Navigator.Lengator););););
If ((Navigator.AppVersion.Indexof ("Mac")! = -1) && (Navigator.Userages.Indexof ("msie")! = -1) && (parseint (navegator.appversion))
Window.open (outro, "sub", 'scrollbars = sim');
if (Target> = 4) {
if (Navigator.appName == "Netscape") {
varmachakfull = window.open (outro, "Machakfull", 'scrollbars = sim', 'width ='+x+', altura ='+y+', top = 0, esquerda = 0');
Machakfull.moveto (0,0);
Machakfull.resizeto (x, y);}
if (Navigator.appname == "Microsoft Internet Explorer")
window.open (ou seja, "Machakfull", "tela completa = sim");
}
else window.open (outro, "sub", 'scrollbars = sim');
}
Função mm_goTourl () {//v3.0
var i, args = mm_goTourl.arguments;
for (i = 0; i <(args.length-); i+= 2) avaliação (args [i]+". localização = '"+args [i+1]+"'");
}
//->
</script>
</head>
<corpo bgcolor = "#3366cc" scroll = noonload = "Machakfull ('/bbs/', '')">>
--------------------------------------------------- -------------------------------------------------------- -------------------------------------------------------- ---------------------------------------------------
<Cript>
Window.open ('/', '', 'tela cheia = 1');
window.close ();
</script>
7, caixa de diálogo da web
Copie o código do código da seguinte forma:
<Cript>
window.onload = function () {
Varfeatures = 'Status: 0; Dialogwidth: 470px; DialogHeight: 470px; Dialogtop: 100px; Dialogleft: 100px; Ressizable: 0; Scroll: 0; Centro: 1';
showmodelessdialog ("http: //www.aspxhome/", janela, recursos);
}
Função Mostrar (Laasn)
{{
var obj;
obj = laysn.style;
obj.visibility = 'visível';
}
Função escondida (laysn)
{{
var obj;
obj = laysn.style;
obj.visibility = 'Hidden';
}
</script>
8. A janela infantil abre e fecha a janela dos pais
Copie o código do código da seguinte forma:
<Cript>
Window.open ('http://www.aspxhome.com/'.'width=790, altura = 590');
Window.opner = null;
window.close ();
</script>