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

IE window.parent.document.images problem

Hi everyone,

I have a main page:

--------------------------------------------------
<html><head><title>Test</title>
</head><body>

<img id="img_a" name="img_a" src="image_1.png" alt=""><br>

<object width="0" height="0" type="text/html"
data="/cgi-bin/next_img?img_a">
refresh image
</object>

</body></html>
--------------------------------------------------

and a script next_img generating this code:

--------------------------------------------------
<html><head>
<script language="javascript1.2" type="text/javascript">
<!--
function doLoad() {
setTimeout( "refresh()", 15 * 1000 );
}

function refresh() {
window.parent.document.images["img_a"].src = "image_2.png";
window.location.reload( false );
}
//-->
</script>
</head><body onLoad="doLoad()">
</body></html>
--------------------------------------------------

The Script specifies a new image (image_2.png) and the duration (15 sec)
to show the new image. On timeout the script is called again. The main
page may hold more than one image and object.

The Script looks nice on Mozilla Firebird but can't find the images in IE 6.0.
I also tested some variants of refresh() like:

function refresh() {
var image = window.parent.document.getElementById("img_a");
image.src = "image_2.png";
window.location.reload( false );
}

but no success. What's wrong? Any help you could provide would be
greatly appreciated.

Thanks in advance,

Winfried Koenig
Jul 20 '05 #1
1 10050
@SM
Winfried Koenig a ecrit :
Hi everyone,

I have a main page:

--------------------------------------------------
<html><head><title>Test</title>
</head><body>

<img id="img_a" name="img_a" src="image_1.png" alt=""><br>

<object width="0" height="0" type="text/html"
data="/cgi-bin/next_img?img_a">
refresh image
</object>

</body></html>
--------------------------------------------------

and a script next_img generating this code:

--------------------------------------------------
<html><head>
<script language="javascript1.2" type="text/javascript">
<!--
function doLoad() {
setTimeout( "refresh()", 15 * 1000 );
}

function refresh() {
window.parent.document.images["img_a"].src = "image_2.png";
window.location.reload( false );
}
and trying :
function refresh() {
with(window.parent) { // funny ! why to call window.parent ?
if(document.images) // to awake the array of images
{
document.images.["img_a"].src = "image_2.png";
doLoad(); // if necessary (I don't know)
}
else
alert('your browser not ok');
}
// and I do not understand the utility of next line
window.location.reload( false );
}

perhaps it would be better to preload the new image ?
if(document.images)
{
Img2 = new Image(); Img2.src = "image_2.png";
}
function refresh() {
with(window.parent) {
if(document.images)
{
document.images.["img_a"].src = Img2.src;
}
}
}

//-->
</script>
</head><body onLoad="doLoad()">
</body></html>
--------------------------------------------------

The Script specifies a new image (image_2.png) and the duration (15 sec)
to show the new image. On timeout the script is called again.
??? why to call again ? to see same image ...
'doLoad' opens the image after 15 secondes of waiting
and no more ...
The main
page may hold more than one image and object.
and if this script is in this main page
I think you have not to call the window.parent
The Script looks nice on Mozilla Firebird but can't find the images in IE 6.0.


--
************************************************** ************
Stéphane MORIAUX : mailto:st*********************@wanadoo.fr
Aide aux Pages Perso (images & couleurs, formulaire, CHP, JS)
http://perso.wanadoo.fr/stephanePOINTmoriaux/internet/
************************************************** ************
Jul 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Erik-Jan Bakker | last post by:
Hi I am not a javascript expert and I have a problem that the guru's in this newsgroup probably can solve quickly. ;-) I've made a webpage with three frames: top, left and mainframe. I...
4
by: Phillip Parr | last post by:
Hello, I have a nice system where someone clicks on a picture to show the full version. This pops up in a window.open box. It works great, the only problem is that if the user clicks a second...
1
by: Jiri Brada | last post by:
Hi, I have got a following problem with using Javascript: I have a HTML page with pictures' thumbnails. After clicking on any thumbnail, I would like to open a new window with the original...
19
by: Darren | last post by:
I have a page that opens a popup window and within the window, some databse info is submitted and the window closes. It then refreshes the original window using window.opener.location.reload(). ...
14
by: D. Alvarado | last post by:
Hello, I am trying to open a window containing an image and I would like the image to be flush against the window -- i.e. have no padding or border. Can I make this happen with a single call to a...
7
by: MrFez | last post by:
Through some investigation it appears that selecting "Every visit to the page" for the IE caching setting "Check for new version of stored pages" causes the window.opener property of child windows...
1
by: pingalkar | last post by:
Hi, In my application, I call one popup winodow by using this link.. <a href="#" onClick="return showWindow('1','XYZ');"> <img src="images/magnifier.gif" ALT="Chemicals"...
1
by: soms2m | last post by:
HELLO ALL, I want to fill the parent window height with respect to the sub window height which is loading using ajax (mootools). For example if the parent window height is normal and the loading...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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?

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.