Skip to main content
Inspiring
September 2, 2008
Question

Javascript Refreshed page does not bring back current data

  • September 2, 2008
  • 6 replies
  • 921 views
I have the following javascript below that closes the action page and then "refreshes" the referring page that the form (a popup) came from. However, I am finding that the referring page does not refresh with the data that was submitted via the popup form--I have to right click and reload the page. Is there a better way to refresh the page so that my submitted data is reloaded?

Thanks!

<cfoutput>
<script language="javascript" type="text/javascript">
function closeRefresh() {
window.opener.location.href='https://a_website.com/#url.opptyID#';
self.close();
}
</script>
</cfoutput>
    This topic has been closed for replies.

    6 replies

    Inspiring
    October 9, 2008
    I had a scenario where the parent page would refresh, but it would run it's select query before the records from the pop-up were inserted. I added a 100 msec timeout to solve that problem.
    Participating Frequently
    October 9, 2008
    I think you are totally right here
    September 5, 2008
    This may or may not be related, but in the past I came across an issue with an iframe in which I was passing it url variables. Occasionally, the page would not be udpated despite continuing to click on a link to refresh the page.

    The solution that I found, was to add a unique variable to the url, such as a random number, to ensure that the browser recognizes that the url is a distinct url, and it is not caching the page.
    September 12, 2008
    Hmmmm... I tried that but it would not reload the page correctly. I do not have edit rights to the page that needs to be refreshed (its a salesforce.com application).
    Inspiring
    September 3, 2008
    <cfoutput>
    <script language="javascript" type="text/javascript">
    function closeRefresh() {
    var ts = new Date();
    window.opener.location.href='https://a_website.com/#val(url.opptyID)#&ts=' + ts.toString();
    self.close();
    }
    </script>
    </cfoutput>
    Inspiring
    September 3, 2008
    Hi,

    You are defining the function "closeRefresh", but where do you call it?

    this should do it:

    <cfoutput>
    <script language="javascript" type="text/javascript">
    window.opener.location.href='https://a_website.com/#url.opptyID#';
    self.close();
    </script>
    </cfoutput>

    cheers,
    fober
    BKBK
    Community Expert
    Community Expert
    September 2, 2008
    You need an event or button to run the function. I also think self.close() is unnecessary. It could be as simple as

    <cfoutput><button onclick="location.href='https://a_website.com/#url.opptyID#';">Refreshed form</button></cfoutput>