473,385 Members | 2,243 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

issue with refreshing pages using JavaScript.

48
We have an issue with refreshing pages using JavaScript.
We have got three pages. From page 1, page 2 is opened by window.open and from page 2, page 3 open up by window.open and also closes page 2. Now on submitting page 3, can we refresh page 1 ?
Is there any method to do this using JavaScript ?
Apr 4 '08 #1
8 1479
gits
5,390 Expert Mod 4TB
i think you just have to pass the reference to the windows ... in win2 you have the refernce to the opener as:

Expand|Select|Wrap|Line Numbers
  1. // declare that globally in your win2
  2. var orig_opener = window.opener;
  3.  
now you could use that in win3 with:

Expand|Select|Wrap|Line Numbers
  1. var orig_opener = window.opener.orig_opener;
  2.  
now you have the reference to win1 stored in orig_opener.

kind regards
Apr 4 '08 #2
hsriat
1,654 Expert 1GB
That's possible. Do it like this.

File a.htm[html]<h1>File A</h1>
<button onclick="window.open('b.htm');">Open B</button>[/html]
File b.htm[html]<h1>File B</h1>
<button onclick="window.open('c.htm');">Open C</button>[/html]
File c.htm[html]<h1>File C</h1>
<script>
var w = window.opener.opener;
window.opener.close();
</script>
<button onclick="w.location.replace('a.htm');">Refresh A</button>[/html]


Harpreet


[EDIT: Sorry Gits, I didn't see your post before posting]
Apr 4 '08 #3
gits
5,390 Expert Mod 4TB
:) no problem ... no need to apologize ... may be your post makes it a bit more clear in case the OP wouldn't know how to use the opener ...

kind regards
Apr 4 '08 #4
hsriat
1,654 Expert 1GB
:) no problem ... no need to apologize ... may be your post makes it a bit more clear in case the OP wouldn't know how to use the opener ...

kind regards
Well, if that would be the case, I'll take my sorry back. :D

Regards
Apr 4 '08 #5
CF FAN
48
ok big thanksss. this thing we have tried as u post. it is perfect in this case.thankssss...........


now we have the problem with more than 3 windows opening. So need to know if we can set a name for the first page and then reference it.
Apr 7 '08 #6
gits
5,390 Expert Mod 4TB
just pass the reference to every new opened window as we showed you ...

kind regards
Apr 7 '08 #7
kunal pawar
297 100+
on 3rd page just use javascript code window.opener.location.reload();
Apr 9 '08 #8
CF FAN
48
ok Thanks ..working fine
Apr 10 '08 #9

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Mr. x | last post by:
Hello, How can I force refreshing of my web site, when a visitor enter my site. Thanks :)
3
by: John Ortt | last post by:
I appologise for reposting this but I have been trying to find a solution all week with no avail and I was hoping a repost might help somebody more knowledgable than myself to spot the message... ...
31
by: Greg Scharlemann | last post by:
Given some recent success on a simple form validation (mainly due to the kind folks in this forum), I've tried to tackle something a bit more difficult. I'm pulling data down from a database and...
8
by: -Karl | last post by:
Apparently, asp.net has a posting issue with refreshing. There seems to be several solutions to the issue but I was wondering if there is a final workaround for the issue? If so, can you please...
3
by: Purti Malhotra | last post by:
Hi All, In our Web hosting environment we are using Virtual hosting i.e. multiple websites are on one server and multiple domains are pointing to a single website. Issue: We have two domains...
13
by: honey99 | last post by:
Hi! I have to fix a problem in JSP.Actually,i have a JSP page say Ex1.jsp.In this Ex1.jsp i have an anchor tag which links into another JSP page i.e when i click on the link another pop-up window...
0
by: Bali | last post by:
Default.aspx is the starting page containing a control(ascx) which has asp:button control on it. On the button click event it has to open a new page as a modal control. Since refreshing a page in...
1
by: Bali | last post by:
Default.aspx is the starting page containing a control(ascx) which has asp:button control on it. On the button click event it has to open a new page as a modal control. Since refreshing a page in...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.