View Full Version : New window
wanapitei
02-21-2008, 06:14 PM
Most of the time I like to maintain the same window with links. But there are occasions when I'd like a new window appear, leaving the current window in place, one layer behind. Is there syntax available to modify the following to force the creation of a new window when clicked?
We invite your <a href="../contactUs.html">comments</a>.
Appreciated.
thetestingsite
02-21-2008, 06:17 PM
We invite your <a target="_blank" href="../contactUs.html">comments</a>.
or
We invite your <a onclick="return window.open(this.href);" href="../contactUs.html">comments</a>.
Hope this helps.
wanapitei
02-21-2008, 08:30 PM
We invite your <a target="_blank" href="../contactUs.html">comments</a>.
Works as desired.
We invite your <a onclick="return window.open(this.href);" href="../contactUs.html">comments</a>.
This one has the side effect of not only opening a new window with the desired page, but also switching the original window to this page as well, not desired in this case.
Kind regards,
thetestingsite
02-21-2008, 08:33 PM
For that second one, I typed it in wrong. It should be like so:
We invite your <a onclick="window.open(this.href); return false" href="../contactUs.html">comments</a>.
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.