Link to home
Start Free TrialLog in
Avatar of yourbudweiser
yourbudweiser

asked on

Refresh Main Window

I open a popup window:

var windowHandle = '';
function popOpen(url,name,attributes) {
         windowHandle = window.open(url,name,attributes);
}

The popup window contains a form that submits to iself, does some processing and then reloads itself.

I want to refresh the main page after the processing is done in the popup window.

When i try to use window.opener I get error "Class doesn't support automation..."

Avatar of Pravin Asar
Pravin Asar
Flag of United States of America image

after refresh

window.opener.refresh();
I mean

After processing your page in the child window.. do

window.opener.refresh();

ASKER CERTIFIED SOLUTION
Avatar of Pravin Asar
Pravin Asar
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of yourbudweiser
yourbudweiser

ASKER

thanks for the response

When i try to use window.opener I get error "Class doesn't support automation..."
try

self.opener instead of window.opener


You can use window.opener in the child page, only if you had opened the child page using the window.open() method in the parent page. If you have opened another page using a hyperlink with the target="_blank", both can't communicate with each other.

Am I right?
sorry for the delay in responding but none of these suggestions work...

based on my original question, can I modify the popup script so that the original page is refreshed?
ha! i found the answer to the problem !

using the code above, I would get a JS error "Class doesn't support automation."

I fixed this issue by clicking on "Start Menu" - "Run", and entering the following entries on command prompt:

regsvr32 msscript.ocx   [enter]
regsvr32 dispex.dll   [enter]
regsvr32 vbscript.dll   [enter]

and now the window.opener works !