Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Nov 2010
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Refresh parent when popup get submitted

    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.

  • #2
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,919
    Thanks
    79
    Thanked 4,423 Times in 4,388 Posts
    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,
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •