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

location.href works in IE but not Firefox

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
6 6283
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
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
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
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

<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
Perfect. Solved the problem. Thank you very much.

Sep 9 '05 #7

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

Similar topics

1
by: Bryan | last post by:
Hi, I have a form that I want to click a button on and cause the location.href to change. this is what I used: the function: function testform(){ location.href="http://www.google.com" }
8
by: Phil Powell | last post by:
if (document.location.href.indexOf('?') >= 0) document.location.href = document.location.href.substring(0, document.location.href.indexOf('?')); if (document.location.href.indexOf('#') >= 0) {...
2
by: COHENMARVIN | last post by:
Folks, I wrote a simple javascript script, but it doesn't work. First I have a web page that uses frames: ===================== <html> <frameset rows="10%,90%"> <frame src="frame1.htm"...
3
by: alison | last post by:
I am trying to redirect the parent page when the user clicks an html button in an aspx page by using the javascript: window.opener.location.href="EditOrders.aspx"; This works fine on IE for...
6
by: G*rd*n | last post by:
I have been using the HTTP "Location" reponse header to direct a symbolic request to a CGI program to an actual URL/file. For example, let us suppose the CGI program's table indicates xyz ->...
4
by: Jeff Paffett | last post by:
I'm writing a file manager application using Ajax techniques and the client wants to be able to bookmark file searches. I send the search request to a remote server using a XMLHttpRequest and then...
1
by: Tazy | last post by:
does anyone know the work around using location.href with firefox. it doesn't work with firefox but fine with ie. please help, doug
1
by: power9888 | last post by:
Can anyone help to resolve this issue please? I have a bookmark in the page #top. I need to use javascript to move to the move mark top. However, the javascript location.href = "#top"; does not...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.