Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Auto refresh an unrelated page

Posted on 2002-05-12
21
Medium Priority
?
389 Views
Last Modified: 2011-08-18
hi All,

Do you know how to trigger a refresh in another page using a hyperlink or a system button or even an auto refresh? This page is unrelated to the page that triggers it.

Dawn.
0
Comment
Question by:Dawn_rico
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 13
  • 5
  • 2
  • +1
21 Comments
 
LVL 30

Expert Comment

by:third
ID: 7005026
if it's unrelated then you don't have control on it.
0
 

Author Comment

by:Dawn_rico
ID: 7005093
hi third,

Thanks for offering ur help again :) but is there any other way to do it, cos' I really need to do it.

Thanks ...

Dawn.
0
 

Author Comment

by:Dawn_rico
ID: 7005094
like in PageA, when we use a hyperlink, we can go to the other PageB. But now instead of going there, I need a solution to refresh that unrelated page.

Thanks for all ur help!
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Expert Comment

by:sushifish
ID: 7005138
If you want to refresh Page1.html in page2.html. then you should code your javascript in page2.html

source code:

function Refresh(){
document.form_name_for_page1.html.submit();
}


hope this help.
0
 
LVL 30

Expert Comment

by:third
ID: 7005139
Hi Dawn,

so you mean both PageA and PageB are already opened and they're of different browser window? when was PageB created? can you tell the whole situation so we can formulate another method if possible?
0
 

Author Comment

by:Dawn_rico
ID: 7005164
hi sushifish ,

I've tried this but I've this error msg - 'Error On Page', but thanks for ur suggestion ..

function refreshPage() {
     var iframename = "AI_POS_Sales004";
     document.AI_POS_Sales004.asp.submit();
     //top.window.close();
}

<a href="javascript:refreshPage();">Close</a>

-------------------------------------------------------
hi third :) and Other Experts

PageA that I wanted to refresh is one of the window in a frame. PageC is another window in the same frame. In PageC, I click to open a pop out window PageB. Upon finish some execution, I close PageB and refresh PageA with the latest ammended data.

Thanks :)

Dawn.

0
 

Author Comment

by:Dawn_rico
ID: 7005168
hi sushifish ,

Perhaps you can show me how  you have implemented it? Thanks

Dawn.
0
 

Author Comment

by:Dawn_rico
ID: 7005173
hi sushifish ,

I just noticed that you're using - submit();

Are you referring to a form post? Sory to let you know now that I'm actually using a hyperlink to do the refresh ..

Thanks ..

Dawn.

0
 
LVL 30

Expert Comment

by:third
ID: 7005192
now its clear for me. you can always reference from PageA using the frames property of the window. now if you're closing PageB from PageC, you can use after the closing script,

parent.frames['PageA'].location.reload();

or if you're closing from the popup window (which is PageB) use,

opener.parent.frames['PageA'].location.reload();

btw, do the pages on this frames reside only on one server?

tell me if that works.
0
 

Author Comment

by:Dawn_rico
ID: 7005217
hi third,

I'm closing from the pop out PageB. This is how I do but I ve the same error. Rechecking the rest of my codes, they're not causing this error.

<script language="JavaScript">
<!--
function refreshPage() {
     //opener.parent.frames['AI_POS_Sales004'].location.reload();
     opener.parent.frames['AI_POS_Sales004.asp'].location.reload(); }
//-->
</script>


May I know where shld I put 'window. now'? I guess maybe I require this to make the whole thing work?

Thanks :)

Dawn.
0
 
LVL 30

Accepted Solution

by:
third earned 1000 total points
ID: 7005229
no, you should not do it that way. so should refer to the frame name u declared in the frameset. referring to the frames array is another way.


<HTML>
<FRAMESET>
<FRAME FRAMEBORDER="0" NORESIZE NAME="PageA" SRC="PageA.html">
<FRAME FRAMEBORDER="1" NORESIZE NAME="PageC" SRC="PageC.html">
</FRAMESET>
</HTML>


based here you can use,

opener.parent.frames['PageA'].location.reload();

or

opener.parent.frames[0].location.reload();


zero[0] refers to the first frame in your frameset.



0
 

Author Comment

by:Dawn_rico
ID: 7005279
hi third

function refreshPage() {
     opener.parent.frames['LeftFrame1'].location.reload();
     top.window.close();
}


I'm using this and guess what ... I got it! Yeh! Thanks a lot hor :) haha

Dawn.
0
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 7005282
Assuming your link is to a static html page you do not own, try this:


<a href="http://www.othersite.com/page1.html"
target="othersiteWindow"
onClick="this.href=this.href+'?'+Math.random()">Reload page</a>

If it is not static, you can try

<a href="http://www.othersite.com/somecgi.pl?someparms"
target="othersiteWindow"
onClick="this.href=this.href+'&dummy='+Math.random()">Reload page</a>


Michel
0
 

Author Comment

by:Dawn_rico
ID: 7005289
hi mplungjan ,

thanks for your offering ur help :)

Dawn.
0
 

Author Comment

by:Dawn_rico
ID: 7005306
hi mplungjan ,

Do you mind looking at this qn on opening a toolbar-less window? .. thanks ..

http://www.experts-exchange.com/jsp/qManageQuestion.jsp?ta=javascript&qid=20298140

Dawn.
0
 
LVL 30

Expert Comment

by:third
ID: 7005321
hi Dawn,

i'm so glad your problem was already solved!

HaPpY PrOgrAmMiNg!!!

;-),

third
0
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 7005338
Dawn: What solution did you implement?
0
 

Author Comment

by:Dawn_rico
ID: 7010260
huh ... no, it's not solved yet ...

Dawn.
0
 

Author Comment

by:Dawn_rico
ID: 7010264
wait, wait, this qn is solved !! :) I had mixed it up with our the other qn ..opps sorry, third  .. :)
0
 

Author Comment

by:Dawn_rico
ID: 7010279
hi All,

This is how I've implemented third's solution! and third, :D programming too

This is the frame that contains the unrelated pageA and to be triggered pageC that is used to pop up pageB..

<HTML>
<FRAMESET>
<FRAME FRAMEBORDER="0" NORESIZE NAME="PageA" SRC="PageA.html">
<FRAME FRAMEBORDER="1" NORESIZE NAME="PageC" SRC="PageC.html">
</FRAMESET>
</HTML>
-----<HTML>
<FRAMESET>
<FRAME FRAMEBORDER="0" NORESIZE NAME="PageA" SRC="PageA.html">
<FRAME FRAMEBORDER="1" NORESIZE NAME="PageC" SRC="PageC.html">
</FRAMESET>
</HTML>
--------------------------------------------------------
This is in pageB. When I click on the link, not only will my pageA in e frame refreshes, pageB will also close.

<script language="JavaScript">
<!--
function refreshPage() {
    opener.parent.frames['LeftFrame1'].location.reload();
    top.window.close();
}
//-->
</script>


<font face=Tahoma size=2 color=#000000><b><a href="javascript:refreshPage();">Close</a></b></font>

0
 

Author Comment

by:Dawn_rico
ID: 7010283
sorry, it only contains this portion in the frame.

<HTML>
<FRAMESET>
<FRAME FRAMEBORDER="0" NORESIZE NAME="PageA" SRC="PageA.html">
<FRAME FRAMEBORDER="1" NORESIZE NAME="PageC" SRC="PageC.html">
</FRAMESET>
</HTML>


LeftFrame1 is the name of the pageA, that shld be PageA in this example.

Dawn.
0

Featured Post

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In my daily work (mainly using ASP.net), I need to write a lot of JavaScript code. One of the most repetitive tasks I do are the jQuery Ajax calls. You know: (CODE) I don't know if for you it's the same, but for me is soooo tedious to write the …
Having worked on larger scale sites, we found out that you are bound to look at more scalable solutions to integrating widgets, code snippets or complete applications and mesh them into functional sites, in any given composition. To share some of…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

719 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question