View Full Version : Opening A New Window.

02-12-2008, 06:45 PM
Hello DW folks,

I'm currently designing a website. When I click on a link to a webpage, I'd like that page to open in a new window. How can I achieve this?

Any advice appreciated :>)

02-12-2008, 07:43 PM
In the target area in the property inspector select _blank

Or if you are in code view your code would look like this:-

<a href="http://www.google.co.uk" target="_blank">Your Link</a>

02-12-2008, 08:02 PM
or in javascript use the window.open method

this way you can control window size

02-13-2008, 11:19 AM
Cheers. I'll try it this afternoon :>)

02-15-2008, 06:16 PM
It worked fine. I'd like to resize the new window that opens so that it's a lot smaller, though. Wondering how to go about this. Is Javascript already part of my Dreamweaver MX program?

02-16-2008, 04:09 PM
if you used the DW code to open a new window/browser, then you should have seen the fields to set your new window sizes.
<a href="http://www.google.co.uk" target="_blank">Your Link</a>
if you used the code above then, there is no javascript.
but you can do the follwing:

add the following code to the head of your page:

<script type="text/JavaScript">
function MM_openBrWindow(theURL,winName,features) { //v2.0

Then add the follwoing code to your link:

<a href="#" onClick="MM_openBrWindow('','','toolbar=yes,location=yes,st atus=yes,menubar=yes,scrollbars=yes,resizable=yes, width=640,height=480')">

your link


As you can see the first part of the code has an empty link but right after the code call for the funtion MM_openBrWindow(code you hopefully added to the head of your page) and gives you the other properties of your new window. i.e. toolbar, localtion, status,menubar, etc. All the properties that equal yes, means that are turned on. So your new window will have those options.

hope that helps. Try going through your Dreamweaver tutorial or press F1

03-04-2008, 02:02 PM
Cheers. I think I've got my head around this now.

03-04-2008, 02:25 PM
dreamweaverhelp, did you use DW to write this for you, or did you cut'n paste it from somewhere?

Fromthe manual:
http://livedocs.adobe.com/en_US/Dreamweaver/9.0/help.html?content=WSc78c5058ca073340dcda9110b1f693 f21-7b07.html

03-04-2008, 02:47 PM
I think I cut and pasted the codes from the above posts.

03-04-2008, 03:10 PM
Hit F1 for the manual, or use the livedocs explaining popups in my link above. It's quite simple.

03-04-2008, 03:52 PM
Thanks, Domedia. I'll have a perusal later tonight :>)

03-05-2008, 08:03 AM
Really well explained mangofreak...
I use this all the time through the behaviours tab but the code you posted makes much more sense... I'm starting to enjoy this coding business....

Cheers all...