Several usages of window.open and window.location.href
Transferred from: http://zhanz.blogbus.com/logs/73885336.html
Because I want to let window.open not open in the new window, so I found some information
Windows.open ("URL", "Window name", "Window appearance setting");
<a href= "JavaScript:window.open (' webpage.asp ', ' _self ')" > click here </A>
<a onclick= "window.open (' webpage.asp ', ' _self '); void 0" href= "#" > click here </a>
A summary of the parameters of the window.open (reference book adaptation) First look at an example:
[Javascipt:]window.open ("Webpage.asp?", Derek, "Height=100,width=100,status=yes,toolbar=yes, menubar=no,location= No ");
This statement opens a new window, the page is webpage.asp, the parameter is Var, the name is Derek, the height is 100, the width is 100, the status bar and toolbar are displayed, the menu and the address are not displayed.
The individual attribute parameters are summarized as follows:
window = Object.open ([URL] [, name] [, features] [, replace]]])
URL: The URL address of the new window
Name: Names of new windows, can be empty
Featurse: Property control string, in which various properties of the window are controlled, separated by commas.
fullscreen= {yes/no/1/0} is full screen, default No
channelmode= {yes/no/1/0} shows Channel bar, default No
toolbar= {yes/no/1/0} displays toolbars, default No
location= {yes/no/1/0} displays the address bar, default No
directories = {yes/no/1/0} whether the turn button is displayed, the default no
status= {yes/no/1/0} whether the window status bar is displayed, default no
menubar= {yes/no/1/0} whether the menu is displayed, default no
scrollbars= {yes/no/1/0} shows scroll bars, default Yes
resizable= {yes/no/1/0} whether the window is resizable, default no
Width=number window width (pixel units)
Height=number window height (pixel units)
Top=number window distance from top of screen (pixel units)
Left=number window distance from the left side of the screen (pixel units)
In the subject, the second argument is detailed:
The name can be:
_blank means a new window is opened,
_parent represents the parent frame window,
_self means that the window is overwritten,
XXX represents a window covering the name xxx
(each window can be named for him)
cannot be omitted, can be empty!
With Window.location.href can only be opened in the current page, you can not open a new window
<a href= "javascript:window.location.href=webpage.asp" > click here </a>
<a href= "Javascript:window.location.href (' webpage.asp ')" > click here </A>
Open new Window method