473,761 Members | 3,651 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Auto refresh of child window on its current state

1 New Member
Folks,

I want to refresh my child window after a particular interval of time, its working with the following code, but after getting refresh its always forward me on first URL not on the current state of the child site. Below is the code for your reference.

Expand|Select|Wrap|Line Numbers
  1. <html>
  2.  
  3. <script>
  4.  
  5.  var limit="0:10";
  6.  var childWindow = null;
  7.  
  8.  if (document.images){
  9.  var parselimit=limit.split(":");
  10.  
  11.  parselimit=parselimit[0]*60+parselimit[1]*1;
  12.  }
  13.  
  14.  function beginrefresh(){
  15.  if (!document.images)
  16.  return;
  17.  
  18.  if (parselimit==1){
  19.      window.location.reload();
  20.      alert('1');
  21.     newwin();
  22.      }
  23.  else{
  24.          parselimit-=1;
  25.          curmin=Math.floor(parselimit/60);
  26.          cursec=parselimit%60;
  27.      if (curmin!=0)
  28.          curtime=curmin+" minutes and "+cursec+" seconds left until page refresh!";
  29.      else
  30.          curtime=cursec+" seconds left until page refresh!";
  31.     window.status=curtime;
  32.      setTimeout("beginrefresh()",1000);
  33.  }
  34.  }
  35.  
  36.  
  37.  function newwin()
  38.  {
  39.  
  40.     if(childWindow ==null){
  41.     childWindow = window.open('http://www.hsbc.co.in','Childwindow','status=0,toolbar=0,menubar=0,resizable=0,scrollbars=1,top=50 ,left=50,height=375,width=650');
  42.     }
  43.  
  44.  
  45.  }
  46.  
  47. function checkChildURL(windowObject) {
  48.   var url = "error";
  49.   try {
  50.    url  = windowObject.location.href;
  51.   } catch(e) {
  52.   // we don't actually catch anything, we just want to stop the error from throwing
  53.   }
  54.  alert(url);
  55. }
  56.  
  57.  
  58.  
  59. window.onload=beginrefresh
  60.  
  61.  </script>
  62. </html>
Sep 20 '07 #1
2 4968
dmjpro
2,476 Top Contributor
Welcome to TSDN.
Use Code Tags while you do Post.
If you want to refresh the child window then try this.

Expand|Select|Wrap|Line Numbers
  1. childWindow.location.reload();
  2.  
Good Luck.

Kind regards,
Dmjpro.
Sep 20 '07 #2
pbmods
5,821 Recognized Expert Expert
Heya, Ajain. Welcome to TSDN!

Please use CODE tags when posting source code:

[CODE=javascrip t]
JavaScript code goes here.
[/CODE]
Sep 20 '07 #3

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

Similar topics

1
2038
by: Martin | last post by:
I have a web page (IE only; intranet only) that is both wider and longer than the browser window. I've noticed that if the user has scrolled the page DOWN and then refreshes the page, the new page automatically scrolls down to same position. However, this automatic scrolling does NOT happen if the user has scrolled over towards the right side. Is there a setting that needs to be adjusted to get this to happen? Or something I need to do...
3
4792
by: MEM | last post by:
Hello, I'd like to refresh the main or top most browser window from a child window. Specifically, child popup A is opened by a main browser window then child popup B is opened from within child popup A. How do i refer to the very first parent window? Visual...
3
5617
by: James Spibey | last post by:
Hi, I have an MDI application which has aboout 10 child windows. The way the app needs to work is that only one window should be visible at a time and it should be maximized within the parent window. I have set all my child windows to be WindowState.Maximized but after showing 2 or 3 windows, the windows all drop back to Normal state. I have tried various things to overcome this inclusing overriding OnResize etc but none seem to give...
2
23510
by: Raj | last post by:
Hi All, I have a problem with trying to refresh the parent window from child window in order to update data in the parent window. The sequence of events are 1) I click a button in the parent window to open a child window thru javascript window.open 2) I have some functionality in the child window that changes the data
0
1682
by: Brad White | last post by:
Overview: I have a custom web app that has an 'Inbox' that refreshes every 30 seconds. One user uses Outlook to host the web page. Using IE, the refresh works fine. If the user is working in another window, the web page quietly refreshes in the background. Hosted in Outlook, the refresh causes Outlook to come to the front on every refresh. Or in XP, causes the toolbar icon to flash.
10
4029
by: Charles Law | last post by:
For some reason, when I click the X to close my MDI parent form, the action appears to be re-directed to one of the MDI child forms, and the parent remains open. I am then unable to close the application. What should happen, is that the main MDI form should close, taking the child forms with it. There is code to loop through the child forms, remove the controls on each of them, and then close the form, but this code should execute only...
7
22733
by: Brian | last post by:
hello, I am looking for a way to auto refresh a web page that I created, but also let the user choose to stop the auto refresh. I can not figure out how to stop the auto refresh. Any help would be appreciated. Thanks, Brian
3
2256
by: Natygan | last post by:
Hi, I've got a Web page which can become a parent window : some links use "window.open" to open the desired link into a new child window. This parent window has got an auto-refresh functionality (<meta http-equiv="refresh" content="60">). My point is that when I'm looking at the child window, I don't want the parent window to take the focus when refreshing. Does anybody have an idea ? Thanks !
0
9522
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9948
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9765
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7327
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6603
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5215
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5364
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
3446
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2738
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.