Click to See Complete Forum and Search --> : pop up popping under... help?


lazzerous
03-16-2004, 11:18 AM
ok... I'm calling window.open

The new window opens, but then pops under the page that called it... why is this happening?


<script language='javaScript'>
window.open('part_builder_results.cinch?specs_id=$specs_id&optionsets=$optionsets_serialized','PartBuilderResults','status=yes,scrollbars=yes,toolbar=no,locati on=no,directories=no,menubar=no,resizable=yes,width=800,height=300');
</script>


Any help provided is greatly appreciated

Thank you,
-=Lazz=-

TheBearMay
03-16-2004, 11:26 AM
Sounds like the parent isn't yielding focus. Try something like:


pWin=window.open(.....
pWin.focus();

lazzerous
03-16-2004, 11:35 AM
negatory

the win still pops under...

this makes no sense!

jaegernaut
03-16-2004, 11:45 AM
Can you post your HTML as well, or a link to it?

Sounds like you might have another focus() statement later in the code that pulls it back to the parent, but I can't tell with just this post.

lazzerous
03-16-2004, 01:25 PM
posting the code would be difficult as three different PHP scripts go into this tool (there's a lot to it), so I'll just present a link:

http://dev.cinch.prohosters.com/view_item.cinch?section_id=15&section_title=Cylindrical&sub_section_id=68&%20sub_section_title=CN0966%20Series%20Self%20Locking%20Plug%20Connectors&item_id=213

jaegernaut
03-17-2004, 07:23 AM
Looking at your current files, you no longer have an automated popup window, but have it working off a link. That popup comes up fine and has focus.

Here is the code I saw:
<a href="#" onClick="window.open('part_builder_results.cinch?specs_id=24&optionsets=','PartBuilderResults','status=yes,scrollbars=yes,toolbar=no,location=no,directories=no,m enubar=no,resizable=yes,width=800,height=300')">If you are running a popup blocker, try clicking here to view the results.</a>

I checked the external js file and saw two window.open there but they were by function. So, I'm not seeing what the problem is.

Please restate if you are still having trouble with this.

lazzerous
03-17-2004, 08:12 AM
The code in question only appears when the form is submitted with usable results.

here is the output:
<script language='javaScript'>
pWin=window.open('part_builder_results.cinch?specs_id=24&optionsets=a:8:{i:0;a:1:{i:0;s:6:\"CN0966\";}i:1;a:1:{i:0;s:1:\"B\";}i:2;a:1:{i:0;s:2:\"16\";}i:3;a:1:{i:0;s:1:\"N\";}i:4;a:1:{i:0;s:1:\"8\";}i:5;a:1:{i:0;s:1:\"S\";}i:6;a:1:{i:0;s:1:\"8\";}i:7;a:2:{i:0;s:3:\"000\";i:1;s:3:\"200\";}}','PartBuilderResults','status=yes,scrollbars=yes,toolbar=no,location=no,directories=no,menubar=n o,resizable=yes,width=800,height=300')
pWin.focus();</script>

jaegernaut
03-17-2004, 08:33 AM
There was a lot there that I didn't understand, so you may get better advise from someone else.

That being said, you can do this:

In the popup window add the onBlur event to the body tag.

<body bgcolor="#ffffff" marginwidth=0 marginheight=0 leftmargin=0 rightmargin=0 topmargin=0 bottommargin=0 onBlur="focus();"> This will bring the popup back to focus if you click off of it. The issue here is that the popup will be on top until you close it.