Diana Coppenbarger wrote:[color=blue]
> Hi,
>
> I have a calendar program that is popped up by a HTML so that the user
> can choose a specific date to be filled in via javascript from the
> calendar program. I am using window.open() to start the calendar
> program and then calling my own function "javascript
:opener.setDate()"
> to set the date back on the main window.[/color]
http://jibbering.com/faq/#FAQ4_24
This all works fine if I use[color=blue]
> the current month that is displayed, but as soon as I have to rebuild
> the calendar because they want to go to another month, the opener is
> not being set correctly.[/color]
Please elaborate on "the opener is not being set correctly". What do you
mean? Are you saying that the date is not pasted into some input field
in the opener?
Can you provide an url of your page? That would be so convenient here.
The javascript for popping up the calendar[color=blue]
> window and changing the month looks like:
>
> function popupCal
> {
> calWin = window.open('/cgi-script/calWin','calWin');
> }[/color]
I would set explicitly this calWin as a global variable.
[color=blue]
>
> function changeMonth(month)
> {
> calWin.open('/cgi-script/calWin'+month,'calWin');
> alert(calWin.opener.location);
> if(calWin.opener == calWin){[/color]
The boolean conditional expression should always be false. Immediately
after creating a secondary window, you're querying if the opener is a
pointer reference to the one of its own secondary window. So, that
should always be false.
[color=blue]
> calWin.opener = this; // reset back to main window
> }[/color]
This sort of assignment will (soon?) become impossible to do once
browsers tighten their security. Fooling around with pointers like that
shouldn't be possible. E.g.: Mozilla: NS_ERROR_XPC_BAD_CONVERT_JS
[color=blue]
> alert(calWin.opener.location);
> }
>
> (The alerts were added for debugging.) This all works just fine in
> IE[/color]
it does??
, but when trying from Netscape 7.1 or Mozilla, the calWin.opener is[color=blue]
> not reset and the alert says the calWin.opener.location is the same as
> the calWin.location. Everything I have read about opener says you can
> reset it like this[/color]
Ok, then. Please show me the links, references, documentation,
preferably official documentations.
, but it doesn't seem to work. Does anyone have any[color=blue]
> suggestions?
>
> -Diana[/color]
Best is to start by provide an url to your page.
DU
--
Javascript and Browser bugs:
http://www10.brinkster.com/doctorunclear/
- Resources, help and tips for Netscape 7.x users and Composer
- Interactive demos on Popup windows, music (audio/midi) in Netscape 7.x
http://www10.brinkster.com/doctorun...pe7Section.html