View Full Version : New Window problem

04-03-2006, 08:29 AM
hey all, i'm a little new to HTML but i'm wanting to put an image link into my page that when clicked will open a new window with another website in it.

I've used this code upto now, but clicking this link opens the link in the current window, thus diverting users from my site:

<a href="http://www.url.co.uk" target="_top">

from what i've researched, the code i need to use to open a new window is something like:

<SCRIPT LANGUAGE="javascript">
window.open ('http://www.url.co.uk')

How do i combine these two codes or is it a completely different code?

Any help is appreciated!

Creative Insanity
04-03-2006, 10:45 AM
<a href="http://www.url.co.uk" target="_blank">
You don't need the javascript.

04-03-2006, 11:38 AM
ok thanks!

last question though, which code do i add to that to give the window a name, a set size and no scrollbars or resize handles?

Thanks for you swift response.

04-03-2006, 12:15 PM
I can't remember it all exactly - but use the 'Behaviours' panel in Dreamweaver. Highlight the link and then go to Behaviours and then 'Open link' or something like that. It's really useful once you find it... writes the code for you...


04-03-2006, 12:30 PM
hmm, i need the HTML though unfortuneately, as i'm building my site through a template and the only way i can edit elements more specifically is by adding HTML codes where needed.

I would assume it's something like:

<a href="http://www.url.co.uk" target="_blank" name="URL" width="x"

but it doesn't seem to work, and i also want the menu buttons / scrollbars etc removing.

04-03-2006, 01:25 PM
ekke, don't assume :) You're making up HTML and it doesn't workt that way ;)

In your first question you asked how to open a new browser window, creative insanity told you how that was done.

Then you asked how to change size etc. This can only be done with a javascript generated new window. Jim suggested you use the behaviours panel. You can do this, and go into Code View and grab all the code you need.

If not you can copy from other sources, like the threads in this forum where pop-up windows have been discussed already: