Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Javascript Refreshed page does not bring back current data

Explorer ,
Sep 01, 2008 Sep 01, 2008
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>
831
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 01, 2008 Sep 01, 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>


Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Sep 03, 2008 Sep 03, 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
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Sep 03, 2008 Sep 03, 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>
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Sep 05, 2008 Sep 05, 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.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Sep 12, 2008 Sep 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).
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 09, 2008 Oct 09, 2008
I think you are totally right here
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Oct 09, 2008 Oct 09, 2008
LATEST
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.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources