Solved

Auto refresh an unrelated page

Posted on 2002-05-12
21
378 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
  • 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
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

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 250 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

This article shows how to create and access 2-dimensional arrays in JavaScript.  It includes a tutorial in case you are just trying to "get your head wrapped around" the concept and we'll also look at some useful tips for more advanced programmers. …
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
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…

790 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