...

View Full Version : Refresh parent when popup get submitted



vik21
11-19-2010, 07:22 PM
I'm using submodal-1.6 for popup.

When the popup closes I wanted parent page to refresh.I've tried the following
window.opener.location.load();
window.opener.location.load(true);
location.load();
window.parent.location.reload();

All works for IE, but when coming to mozilla ,firefox the refresh is a step delayed, i.e when I open my popup to add an itme to my cart on parent page ,for the first time it does not show anything , but when I try to add another item , the first one shows.

Any advice would be really great.

Old Pedant
11-19-2010, 10:31 PM
PURE GUESS.

If submitting the popup is making a change in your database, then possibly you have a race condition. The main page is reloaded before the db contents have changed.

If that's the case, there are a couple of solutions.

The best may be to have the popup *not* try to reload the parent until the server comes back saying "done" to the DB operation. Since your popup code (I call it a "popON", since it's all in the same window) is in an <iframe>, just have the <form> submit to a page that comes *back* to the <iframe> with the JS code to reload the parent.

But showing code is usually the best way to get help. When you don't all we can do is guess.



Since submodal is just a <div> on the same page,



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum