Creating a popup window in a frame

I start with a client-side image map located in a frame.  When I click on a hot spot, I wish to open a popup window in the same frame, without closing the frame.  I have used:

<AREA SHAPE="circle" coords="717, 53, 10" ALT="Name" href="link1.html" onClick="winOpen(this)">

to call the following function:

function winOpen(theLink) {
        linkWindow=window.open(theLink.href,'resizable=yes,width=190,height=135,status=no,location=no,toolbar=no,directories=no,menubar=no,scrollbars=yes');
}

Doesn't work.  What do I do?
adamssrAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Michel PlungjanIT ExpertCommented:
<AREA SHAPE="circle" coords="717, 53, 10" ALT="Name" href="javascript:winOpen('link1.html')">

function winOpen(theUrl) {
                    linkWindow=window.open(theUrl,'resizable=yes,width=190,height=135,status=no,location=no,toolbar=no,directories=no,menubar=no,scrollbars=yes');

}

Netscape in particular does not like the onClick in area tags

Michel
0
adamssrAuthor Commented:
Looks good, but when I tried it, I got an error message (invalid argument).
0
Michel PlungjanIT ExpertCommented:
That is because your window.open is invalid - needs a window name, sorry I didn't spot that.

window.open(theUrl,'windowname','width=190,height=135,resizable,scrollbars')

Michel
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
The Ultimate Tool Kit for Technolgy Solution Provi

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy for valuable how-to assets including sample agreements, checklists, flowcharts, and more!

mblaseCommented:
Give him his points back. He forgot to wedge a name for the window between the URL and the attributes:

linkWindow=window.open(theUrl,someName,'resizable=....');
0
Michel PlungjanIT ExpertCommented:
Thanks mblase

Spotted it too  ;-)
0
adamssrAuthor Commented:
Thanks, Michel.  Works fine.  Now, if I click on another hot spot on the image map, how can I make the new popup window replace the first?  I'll repost this second question with another 50 points for you if you can answer it.
0
mblaseCommented:
That's easy -- call winOpen() with a new URL. As long as it uses the same window name and parameters, it'll keep using the same popup window.

You may, however, want to add 'windowname.focus()' to your winOpen() function, to bring that window back to the front.
0
Michel PlungjanIT ExpertCommented:
or better, use
<BODY onLoad="if(window.focus) self.focus()">

in the new windows.

Michel

PS: Thanks for your enthusiasm, mblase...
0
mblaseCommented:
Hey, I like a race as much as anyone. :) (I'm not trying to steal anyone's points -- by all means, adamssr, give 'em to Michel.)

Now, Michel, you've been on here long enough this morning -- shouldn't you get back to work and let the rest of us earn some points? ;-)
0
adamssrAuthor Commented:
Thanks again, Michel.  Works great.  Will post the new question as "For Michel".  Reply something and I'll give you the points.

Thanks also, mblase, but I like Michel's answer.
0
Michel PlungjanIT ExpertCommented:
Hehe - save your points Adam...

I will go home, give mblase a few hours to stalk the questions ;-)

Michel
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
JavaScript

From novice to tech pro — start learning today.