Solved

Auto refresh an unrelated page

Posted on 2002-05-12
21
373 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
Comment Utility
if it's unrelated then you don't have control on it.
0
 

Author Comment

by:Dawn_rico
Comment Utility
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
Comment Utility
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
 

Expert Comment

by:sushifish
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
hi sushifish ,

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

Dawn.
0
 

Author Comment

by:Dawn_rico
Comment Utility
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
Comment Utility
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
Comment Utility
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
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 
LVL 30

Accepted Solution

by:
third earned 250 total points
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
hi mplungjan ,

thanks for your offering ur help :)

Dawn.
0
 

Author Comment

by:Dawn_rico
Comment Utility
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
Comment Utility
hi Dawn,

i'm so glad your problem was already solved!

HaPpY PrOgrAmMiNg!!!

;-),

third
0
 
LVL 75

Expert Comment

by:Michel Plungjan
Comment Utility
Dawn: What solution did you implement?
0
 

Author Comment

by:Dawn_rico
Comment Utility
huh ... no, it's not solved yet ...

Dawn.
0
 

Author Comment

by:Dawn_rico
Comment Utility
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
Comment Utility
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
Comment Utility
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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

This article will give core knowledge of JavaScript and will head in to your first JavaScript program. I am Durvesh Naik and I am here to deal with this series of JavaScript. I will teach you JavaScript in part wise , as its quite boring to read big…
JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
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…

762 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now