location.href works in IE but not Firefox

B

baranabas

I have looked, but I can't seem to find an explanation for the problem
I am having. I have a page that show an image from another server. I
want the image to refresh without refreshing my page. (My page has a
huge flash movie on it that is sucking my bandwidth.) I have devised
the solution below which works only in IE, but not if Firefox or Opera
or Safari. I would really appreciate any help.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">
<title>Untitled Document</title>
<script language="javascript" type="text/javascript">
<!--
function refresh_iframe()
{
self.frames['webcam'].location.href =
"http://instacam.com/instacamimg/DLTH1/DLTH1_S.jpg";
setTimeout("refresh_iframe()", 3000);
}
//-->
</script>
</head>

<body>
<iframe src="http://instacam.com/instacamimg/DLTH1/DLTH1_s.jpg"
frameborder="0" scrolling="no" marginheight="0" marginwidth="0"
width="320" height="240" id="webcam" name="webcam"></iframe>
<script type="text/javascript">
refresh_iframe();
</script>
</body>
</html>
 
A

ASM

I have looked, but I can't seem to find an explanation for the problem
I am having. I have a page that show an image from another server. I
want the image to refresh without refreshing my page. (My page has a
huge flash movie on it that is sucking my bandwidth.) I have devised
the solution below which works only in IE, but not if Firefox or Opera
or Safari. I would really appreciate any help.

because you allways call same url
and also perhaps did you disactive IE's cache ?

<script language="javascript" type="text/javascript">
<!--
var ind = 0;
function refresh_iframe() {
ind++;
self.frames['webcam'].location.href="http://instacam.com/instacamimg/DLTH1/DLTH1_S.jpg#"+ind;
setTimeout("refresh_iframe()", 3000);
}
//-->
</script>
 
B

baranabas

I am meaning to call the same url. It is a webcam that updates once a
minute.

I do not know how to disactivate the cache in IE, but it is currently
working in IE.

I tried what you suggested and it doesn't seem to work in IE or
Firefox.

I really appreciate your help.
 
A

ASM

I am meaning to call the same url. It is a webcam that updates once a
minute.

I do not know how to disactivate the cache in IE, but it is currently
working in IE.

Your webcam takes a photo each five minutes did I see
Perhars is it normal that nothing changes on each 3 seconds ?

and sometimes : no response ...
I tried what you suggested and it doesn't seem to work in IE or
Firefox.

I really appreciate your help

oh I see (perhaps ?)
try :

var ind = 0;
function refresh_iframe() {
ind++;
p.frames['webcam'].location.href="http://instacam.com/instacamimg/DLTH1/DLTH1_S.jpg#"+ind;
setTimeout("refresh_iframe()", 3000);
}
 
B

baranabas

The webcam only refreshes every few minutes. I set the timeout to 3
seconds for testing.

I tried this suggestion as well and it creates an error.

Thanks again.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top