Click to See Complete Forum and Search --> : new window popup


Xylicon
04-30-2003, 08:35 PM
im using Frontpage XP and i wanna know how to link an image so that when a person clicks on the link it will open up the image in a new window so they don't have to keep clicking the back button they just have to click the "X"

:confused:

khalidali63
04-30-2003, 09:19 PM
add an onclick event in the image tag,
in the onclick event put this code
onclick="javascript:window.open('imageUrl.gif','newWin')"

Falconix
04-30-2003, 09:28 PM
Or just use plain html...

<a href="here.html" target="_blank"><img src="image.gif" /></a>

Charles
05-01-2003, 04:54 AM
Originally posted by khalidali63

onclick="javascript:window.open('imageUrl.gif','newWin')"

1) That JavaScript is incorrect though some browsers recover from it nonethless.
2) That will fail for the one in ten users that do not use JavaScript and for the numberless users that have pop-ups disabled.

Use instead:

<a href="http://www.w3.org/" onclick="window.open(this.href); return false"><img alt="the W3C" src="http://www.w3.org/Icons/w3c_home"></a>

Or use the HTML 3.2 version that employs the 'target' attribute.