PDA

View Full Version : New Window problem


ekke287
04-03-2006, 09: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:


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


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')
-->
</script>


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

Any help is appreciated!

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

ekke287
04-03-2006, 12:38 PM
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.

Jim_Shady
04-03-2006, 01: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...

Shady

ekke287
04-03-2006, 01: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"
height="y">
</a>


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

domedia
04-03-2006, 02: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:
http://www.dreamweaverclub.com/forum/viewtopic.php?t=2265
http://www.dreamweaverclub.com/forum/viewtopic.php?t=1921