Robert said:
Does anyone know how to replace <a href="url" target="_blank"> with
window.open, keeping the window settings the same, i.e. same size, same
toolbars, etc.
I've tried document.open, and window.target, but nothing I do seems to
open in a new window.
Cheers, Rob.
You can't do this. There is no way to determine the size of the current
browser window in a cross-browser compatible way. You also can't reliably
detect the current chrome (what menus, toolbars and statusbars might be
showing).
<a href="url" target="_blank"> usually opens a new window with the default
size, position (although windows will shift the window down and to the
right approximately 20 pixels so you can see the titlebar of the original
window) and with the default chrome.
You can attempt to control the chrome using window.open(), but there is no
guarantee you will open a new window, let alone control the chrome that
window has (any new window that a Web site attempts to open gets opened in
a new tab for me in Firefox, so any of your attempts to control the size,
position or chrome of a new window fail).
In the future, check the documentation, rather then trying things at random
hoping it will work. Computer programming (which is what "Javascripting"
is) requires very specific syntax to work correctly.
Information about window.open()
<url:
http://devedge.netscape.com/library/manuals/2000/javascript/1.3/reference/window.html#1202731
/>
<url:
http://msdn.microsoft.com/workshop/author/dhtml/reference/methods/open_0.asp
/>