Click to See Complete Forum and Search --> : Java Error, Please help


dcjones
12-08-2002, 07:27 AM
Hi all, I will start by saying I am new to Java scripting so please be kind.


I have a very small problem. I run this sript:

SCRIPT

function window_open2()
{
var newWindow2;
var urlstring = 'midlandshires.htm'
newWindow =
window.open(urlstring,'midlandshires',
'height=300,width=400,left=180, top= 290, toolbar=no,minimize=no,status=no,memubar=no,location=no,scrollbars=yes'
newWindow2.focus()
}

BODY

<map name="Map2">
<area shape="poly" coords="14,40,9,47,10,54,9,64,11,71,8,85,20,87,71,87,74,26,48,24" href="#" onClick="window_open2()" value='...' name="image" alt="Shropshire, Staffordshire, Derbyshire, Nottinghamshire, West Midlands, Worcestershire, Herefordshire, Gloucestershire, North Oxfordshire, Northamptonshire. Leicestershire" title="Shropshire, Staffordshire, Derbyshire, Nottinghamshire, West Midlands, Worcestershire, Herefordshire, Gloucestershire, North Oxfordshire, Northamptonshire. Leicestershire">
</map>

What I want it to do is when button is click on I want it to open a window. This part work OK.

If the user clicks on the screen outside of the opened window the opened windo goes to the back. This part is OK.

What I now want to happen is if the user clicks on the button to open the same window I want the window at the back to come to the front and not open another window.

Can anyone please help.

Thanks in advance


Dereck

dcjones
12-08-2002, 11:14 AM
Hello Dave

Thanks for your reply. I have used the code you supplied and it work to a point.

When I click on my button again (after the window is loaded and sent to the back ) it flashs the window on the Task Bar (MS IE 6) but does not bring the window to the front. Is there any way of doing this.


Many thanks


Dereck

dcjones
12-08-2002, 05:38 PM
Hi Dave

Can't thank you enough, it now works OK.

any thanks


Dereck:)