473,386 Members | 1,743 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,386 software developers and data experts.

clearInterval() : iframe & window communication problem

gskoli
23
Dear all,
I have given snippet of code in that it is cgi file in which i am using iframe , source of iframe is calling another cgi file.
JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
Expand|Select|Wrap|Line Numbers
  1.       this is ABC.cgi file
  2.       <script type="text/javascript">
  3.       function interval_setting(){ _clear = 5; _clear =  setInterval("xmlhttpPost11('index.cgi','tracker_shower','Latest_frame','Tracker_loader',_clear,'','','')",20000);}
  4.       </script>
  5.  
  6.       <body bgcolor="#FFFFFF"onLoad='interval_setting();'>
  7.       <td bgcolor="#ffffff" height="75">
  8.          <div id = "Tracker_loader" align = 'center' style = "display:none"><img src='/images/ajax-loader.gif'></div>
  9.  
  10.         <iframe id= "Latest_frame" src="bidsupdate.cgi?TYPE=$type" scrolling="no" frameborder="0" height=100% width=100%>
  11.         </iframe>
  12.       </td>
  13.  
  14. this is ABC.cgi file <script type="text/javascript"> function interval_setting(){ _clear = 5; _clear = setInterval("xmlhttpPost11('index.cgi','tracker_shower','Latest_frame','Tracker_loader',_clear,'','','')",20000);} </script> <body bgcolor="#FFFFFF"onLoad='interval_setting();'> <td bgcolor="#ffffff" height="75"> <div id = "Tracker_loader" align = 'center' style = "display:none"><img src='/images/ajax-loader.gif'></div> <iframe id= "Latest_frame" src="bidsupdate.cgi?TYPE=$type" scrolling="no" frameborder="0" height=100% width=100%> </iframe> </td>
  15.  
  16.  
now setInterval function calling xmlhttpPost11() that function is actually a ajax function which is Reloading this iframe(Latest_frame).
now in bidsupdate.cgi i met a condition where i need to stop this setInterval()
but how i can do that ....
can i write some code in bidsupdate.cgi file to clearInterval But how ....

waiting for reply
thanks in advance
May 14 '10 #1
4 3489
gits
5,390 Expert Mod 4TB
basically you would need to clear the interval in the parent frame/window ... so from you iframe-source you would need to do something like:

Expand|Select|Wrap|Line Numbers
  1. parent.clearInterval(_clear);
May 14 '10 #2
gskoli
23
Can i use
Expand|Select|Wrap|Line Numbers
  1. parent.window.clearInterval() 
And one more thing to accessing global variable it was giving me error
so i have written like
Expand|Select|Wrap|Line Numbers
  1. parent.window.clearInterval(parent.window._clear) 
and now it is working .

Thanks a lot ...
May 14 '10 #3
gits
5,390 Expert Mod 4TB
of course :) ... just gave it as an example ... even:
Expand|Select|Wrap|Line Numbers
  1. parent.clearInterval(parent._clear);
should have worked ... parent refers to the window already ...

kind regards
May 14 '10 #4
gskoli
23
Ya thanks ...
May 15 '10 #5

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

Similar topics

2
by: saayan | last post by:
Hi, I have a php generated HTML page, which has a javascript call in the body tag: <body onunload="exitPage()" onload="setWidth()" onresize="setWidth()"> In certain cases, there can be an...
4
by: Sačo Zagoranski | last post by:
Hi! I'm writing a simple 3D First person shooter game. It is a multiplayer game, where all the players connect to one server.
9
by: SJ | last post by:
Here's the scenario Website has a button that pops up a confirmation window when clicked. When the user clicks the "confirm" button in this popup window, I want all the following to happen :...
2
by: Sin Jeong-hun | last post by:
I created a windows form application. It has a Threading.Timer and when the timer ticks it does some work and show a popup window. The problem is that while this program is running if the user...
0
by: =?Utf-8?B?RGF2ZXkgUA==?= | last post by:
I have a button on a web page that performs a window.close() when clicked. The problem is if I do a print preview on this page, then close the preview and click on the close button nothing happens....
2
by: stefaan | last post by:
Hi all, I have a CEdit window in my application which I use as a sort of output console for text generated by my program. Each subsection writes to its own string buffer and every 2 seconds I...
3
by: dazzler | last post by:
My application: "starting window" with some misc. buttons etc. & server socket connection is running at the same time in a new thread. When connection is made, the starting windows is closed and...
3
by: hash4sp | last post by:
Hello Can anyone here please guide me with the Cross Domain Communication between IFrames. Problem: Application1 running on IIS => http://localhost.ad.local/Applicaiton1 Application2...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: 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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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,...
0
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...

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.