By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
460,034 Members | 979 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 460,034 IT Pros & Developers. It's quick & easy.

location.href works in IE but not Firefox

P: n/a
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>

Sep 9 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a
ASM
ba*******@gmail.com wrote:
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>

--
Stephane Moriaux et son [moins] vieux Mac
Sep 9 '05 #2

P: n/a
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.

Sep 9 '05 #3

P: n/a
ASM
ba*******@gmail.com wrote:
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);
}

--
Stephane Moriaux et son [moins] vieux Mac
Sep 9 '05 #4

P: n/a
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.

Sep 9 '05 #5

P: n/a

<ba*******@gmail.com> wrote in message
news:11********************@z14g2000cwz.googlegrou ps.com...
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>


could be a cache issue perhaps, add a random parameter to the url

....DLTH1_s.jpg?random=randomnumber
Sep 9 '05 #6

P: n/a
Perfect. Solved the problem. Thank you very much.

Sep 9 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.