Hello Bogdan,

I greatly appreciated your help. Now it is way better but some behaviours are 
still weird as I describe below:

On Microsoft Internet Explorer:

- If you close the popup window by clicking the close icon, the onunload 
event works just fine.

- If you close the popup window by closing on the link it reloads the parent 
window twice, which is not good because the parent window that I need it to 
be done reads info from a database and this can be time consuming. What 
happens here is that it calls the oldWin function and then the onunload event.

On Netscape and Konqueror:

- if you close the popup window by clicking the close icon, the onunload 
event is not called or recoginized. I wonder if I need to register the events 
with captureEents. If so, how can I do it?

- If you close the popup window by closing on the link it reloads the parent 
window once since it does not recognize the onunload event.

There should be a way by creating a variable or whatever that would not call
the oldWin function twice if the onunload event is fired.

Do you know how to do it?

Could you help me with that?

Thanks again.

regards,

Carlos Fernando.




On Friday 28 December 2001 12:08 pm, Bogdan Stancescu wrote:
> I don't know if this is it, but you may:
>
> 1. Replace
> print("    returnwin=window.opener.navigate(urlLoc);\n");
> with
> print("    window.opener.location='urlLoc';\n");
>
> 2. Try opening the pop-up widow with Netscape allowing the location input
> box to appear, click on "Close e Update" and, if it doesn't work, type
> "javascript:" in the location bow -- then check for errors reported by
> Netscape. 9 cases out of 10, if you solve the problem with Netscape,
> Konqueror will work as well.
>
> Please let me know of your progress - I'm curious what the problem is.
>
> Bogdan
>
> Carlos Fernando Scheidecker Antunes wrote:
> > Hello all!
> >
> > I've wrote to scripts that use Javascript too. The idea is to have a
> > parent window teste_popup.php4 and a child window pop.php4. When a link
> > is clicked on the parent window, the child window will open. After the
> > user enters information on the child window he must close it and that
> > will update the parent window.possibility to me.


Hello all!

I've wrote to scripts that use Javascript too. The idea is to have a parent
window teste_popup.php4 and a child window pop.php4. When a link is clicked
on the parent window, the child window will open. After the user enters
information on the child window he must close it and that will update the
parent window.possibility to me.

But there's a little problem,though.

The only browser that it works is MS IE. It does not work on
Nestcape (Win or *NIX) or Konqueror (*NIX).

If I try it on a different browser, say Netscape or Konqueror, when I click
the main window to open the popup window it does work.
The thing that does not work is when you click close on the popup window. It
does not close the popup window and if I close the window it does not update
the parent window.

I've written two test PHP scripts teste_popup.php4 (the main window) and
pop.php4
that I am including below. Maybe someone can help me out by pointing where
it is
wrong.

teste_popup.php4 (parent window script)

<?php
// teste_popup.php4
print("<html>\n");
print("<head>\n");
//print("<script type=\"text/javascript\">\n");
print("<script language=\"JavaScript\"><!--\n");
print("function newWin(urlLoc) {\n");
print("    _winName=\"Janelateste\";\n");
print("    _info = \"toolbar=no\";\n");
print("    _info += \",location=no\";\n");
print("    _info += \",directories=no\";\n");
print("    _info += \",status=yes\";\n");
print("    _info += \",menubar=no\";\n");
print("    _info += \",scrollbars=yes\";\n");
print("    _info += \",resizable=yes\";\n");
print("    _info += \",titlebar=no\";\n");
print("    _info += \",dependent=no\";\n");
print("    _info += \",channelmode=no\";\n");
print("    _info += \",height=480\";\n");
print("    _info += \",width=640\";\n");
print("    _info += \",left=200\";\n");
print("    _info += \",top=100\";\n");
print("    DispWin=window.open(urlLoc,_winName,_info);\n");
print("} \n");
print("//--></script>\n");
print("</head>\n");
print("<body>\n");
print("<p>\n");
print("Esse e um teste usando Javascript para montar as janelas\n");
print("a parte de numero de operacoes, pecas, etc de garantia.\n");
print("</p>\n");
print("<b>\n");
print("Data : ".date(d."/".m."/".Y." ".H.":".i.":".s)."\n");
print("<b>\n");
print("<br>\n");
print("<br>\n");
print("<a href=\"JavaScript:newWin('pop.php4?oper=1');\">link</a>\n");
print("<br>\n");
print("</body>\n");
print("</html>\n");
?>

pop.php4 - child popup window

<?php
// pop.php4

print("<html>\n");
print("<head>\n");
//print("<script type=\"text/javascript\">\n");
print("<script language=\"JavaScript\"><!--\n");
print("self.menubar.visible=false\n");
print("self.tollbar.visible=false\n");
print("self.locationbar.visible=false\n");
print("self.personalbar.visible=false\n");
print("self.statusbar.visible=false\n");
print("function oldWin(urlLoc) {\n");
print("    returnwin=window.opener.navigate(urlLoc);\n");
print("    window.opener.focus();\n");
print("    window.close();\n");
print("} \n");
print("//--></script>\n");
print("</head>\n");
print("<body onunload=\"JavaScript:oldWin('teste_popup.php4?oper=1')\">\n");
print("<b>\n");
print("Child window\n");
print("</b>\n");
print("<br>\n");
print("Parametro oper = ".$HTTP_GET_VARS["oper"]."\n");
print("<br>\n");
print("<a href=\"JavaScript:oldWin('teste_popup.php4?oper=1')\">Close e
Update</a>\n");
print("<br>\n");
print("</body>\n");
print("</html>\n");

?>

Could anyone help me out to adapt it to any browser?

Thank you very much and merry christmas,

Carlos Fernando Scheidecker Antunes.
Salt Lake City, Utah - USA.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to