I have code where a dialog box window needs to send data back to an opening window (3 back in the chain). This is my code:
The code works just fine in Firefox and Netscape. But it does not work in Internet Explorer. It does not like my initial assignments using the opener property to get an object reference to the original opening window in the chain. My JavaScript reference book says that the opener property of the window object is supposed to be compatible with Internet Explorer version 3 and higher, as well as Firefox.
In Internet Explorer, I get the following error message:
I am using Internet Explorer version 6.0.2900.2180 and version 7.0.5730.13 and have the same results in both versions.
Does anyone know what I am doing wrong and how I can fix my code so it will also work in Internet Explorer as well as Firefox?
Code:
function HandleOK()
{
//window.alert("Close this window.");
var RF_Obj = self.opener.opener.opener.document.DataEntryForm.RF_ComboBox;
var MF_Obj = self.opener.opener.opener.document.DataEntryForm.MF_ComboBox;
if (RFValuesArray[1] > 0)
{
// There is a record count value in the
// array, so a change has been made to the
// RF_ComboBox list, so the ComboBox on
// the Data Entry page needs to
// be updated as well.
// window.alert("Make refresh to RF_ComboBox.")
RefreshListBox(RF_Obj, RFValuesArray, 1);
}
if (MFValuesArray[1] > 0)
{
// There is a record count value in the array,
// so a change has been made to the
// MF_ComboBox list, so the ComboBox on the
// Data Entry page needs to
// be updated as well.FarkFor_ComboBox.")
RefreshListBox(MF_Obj, MFValuesArray, 1);
}
window.returnValue = "";
closeme();
}
The code works just fine in Firefox and Netscape. But it does not work in Internet Explorer. It does not like my initial assignments using the opener property to get an object reference to the original opening window in the chain. My JavaScript reference book says that the opener property of the window object is supposed to be compatible with Internet Explorer version 3 and higher, as well as Firefox.
In Internet Explorer, I get the following error message:
Code:
An error has occurred in the script on this page.
Line: 791
Char: 5
Error: 'document.opener.opener' is null or not an object
Code: 0
URL: [URL unfurl="true"]http://localhost:8500/[/URL] Sup...
Do you want to continue running scripts on this page?
I am using Internet Explorer version 6.0.2900.2180 and version 7.0.5730.13 and have the same results in both versions.
Does anyone know what I am doing wrong and how I can fix my code so it will also work in Internet Explorer as well as Firefox?