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

JAVASCRIPT recusive function

P: n/a
Any ideas why this function is not working.
I am running it locally on my private network.
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<head>
<title>Javascript Webcam for Internet Explorer</title>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">

<script LANGUAGE="JavaScript">
<!-- hide from old browsers
var chgcntr=1;

currentdate = new Date();
currenttime = currentdate.getTime();
function changeit() {
if (chgcntr > 0) {
var imgsingle = "http://192.168.0.1/webcam/webcam.jpeg";

document.imgroom.src = imgsingle;
setTimeout("changeit()",3000);
}
}
//end hide -->
</script>

</head>
<body text="#000066" bgcolor="#FFFFFF" link="#0066FF" vlink="#00AAFF"
alink="#FF0000" onload="changeit()">

<center>
<IMG src="" name="imgroom" alt="Picture" height=240 width=320></img>
</center>
</body>
</html>
Thanks
Jul 20 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
Bartosz Wegrzyn wrote:
Any ideas why this function is not working.
I am running it locally on my private network.
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<head>
<title>Javascript Webcam for Internet Explorer</title>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">

<script LANGUAGE="JavaScript">
<!-- hide from old browsers
var chgcntr=1;

currentdate = new Date();
currenttime = currentdate.getTime();
function changeit() {
if (chgcntr > 0) {
var imgsingle = "http://192.168.0.1/webcam/webcam.jpeg";

document.imgroom.src = imgsingle;
setTimeout("changeit()",3000);
}
}
//end hide -->
</script>

</head>
<body text="#000066" bgcolor="#FFFFFF" link="#0066FF" vlink="#00AAFF"
alink="#FF0000" onload="changeit()">

<center>
<IMG src="" name="imgroom" alt="Picture" height=240 width=320></img>
</center>
</body>
</html>


If you go to this url in your browser do you see an image at
http://192.168.0.1/webcam/webcam.jpeg?

Mike

Jul 20 '05 #2

P: n/a

mscir <ms***@access4less.net> wrote in message
news:10*************@corp.supernews.com...
Bartosz Wegrzyn wrote:
Any ideas why this function is not working.
I am running it locally on my private network.
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<head>
<title>Javascript Webcam for Internet Explorer</title>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">

<script LANGUAGE="JavaScript">
<!-- hide from old browsers
var chgcntr=1;

currentdate = new Date();
currenttime = currentdate.getTime();
function changeit() {
if (chgcntr > 0) {
var imgsingle = "http://192.168.0.1/webcam/webcam.jpeg";

document.imgroom.src = imgsingle;
setTimeout("changeit()",3000);
}
}
//end hide -->
</script>

</head>
<body text="#000066" bgcolor="#FFFFFF" link="#0066FF" vlink="#00AAFF"
alink="#FF0000" onload="changeit()">

<center>
<IMG src="" name="imgroom" alt="Picture" height=240 width=320></img>
</center>
</body>
</html>


If you go to this url in your browser do you see an image at
http://192.168.0.1/webcam/webcam.jpeg?

Mike


Hi,
I guess it's on his private network and not viewable to us.

For test purposes I modified the code slightly to see what I could see.
With the modified changeit() below and 2 images in the same directory as my
html,
I see the alt "text" incrementing and the pictures swapping every 3 seconds.

As noted in other posts, it is always helpful to provide
a more detailed description than "not working".

function changeit() {
if (chgcntr++ > 0) {
var imgsingle0 = "catnglasses.jpg";
var imgsingle1 = "catnfood.jpg";

if (chgcntr % 2 == 0) document.imgroom.src = imgsingle0;
else document.imgroom.src = imgsingle1;

document.imgroom.alt=chgcntr;
setTimeout("changeit()",3000);
}
}
Jul 20 '05 #3

P: n/a

Chris Crandell wrote:
mscir <ms***@access4less.net> wrote in message
news:10*************@corp.supernews.com...
Bartosz Wegrzyn wrote:
Any ideas why this function is not working.
I am running it locally on my private network.
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<head>
<title>Javascript Webcam for Internet Explorer</title>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">

<script LANGUAGE="JavaScript">
<!-- hide from old browsers
var chgcntr=1;

currentdate = new Date();
currenttime = currentdate.getTime();
function changeit() {
if (chgcntr > 0) {
var imgsingle = "http://192.168.0.1/webcam/webcam.jpeg";

document.imgroom.src = imgsingle;
setTimeout("changeit()",3000);
}
}
//end hide -->
</script>

</head>
<body text="#000066" bgcolor="#FFFFFF" link="#0066FF" vlink="#00AAFF"
alink="#FF0000" onload="changeit()">

<center>
<IMG src="" name="imgroom" alt="Picture" height=240 width=320></img>
</center>
</body>
</html>


If you go to this url in your browser do you see an image at
http://192.168.0.1/webcam/webcam.jpeg?

Mike

Hi,
I guess it's on his private network and not viewable to us.
For test purposes I modified the code slightly to see what I could see.
With the modified changeit() below and 2 images in the same directory as my
html,
I see the alt "text" incrementing and the pictures swapping every 3 seconds.

As noted in other posts, it is always helpful to provide
a more detailed description than "not working".

function changeit() {
if (chgcntr++ > 0) {
var imgsingle0 = "catnglasses.jpg";
var imgsingle1 = "catnfood.jpg";

if (chgcntr % 2 == 0) document.imgroom.src = imgsingle0;
else document.imgroom.src = imgsingle1;

document.imgroom.alt=chgcntr;
setTimeout("changeit()",3000);
}
}

Hi Chris,

That's what I thought too (image is only accessible on his local
network), but I though I'd better ask him to make sure the image really
exists at that location, is spelled right, etc.... the code looks okay
to me (I'm no expert though).

Mike

Jul 20 '05 #4

P: n/a
Thanks for your help, but unfortunetaly even you code did not work.

I erased the htm file and I created a new one and it helped.

Thank You

"Chris Crandell" <cc******@ix.netcom.com> wrote in message news:<Bw*****************@newsread2.news.pas.earth link.net>...
mscir <ms***@access4less.net> wrote in message
news:10*************@corp.supernews.com...
Bartosz Wegrzyn wrote:
Any ideas why this function is not working.
I am running it locally on my private network.
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<head>
<title>Javascript Webcam for Internet Explorer</title>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">

<script LANGUAGE="JavaScript">
<!-- hide from old browsers
var chgcntr=1;

currentdate = new Date();
currenttime = currentdate.getTime();
function changeit() {
if (chgcntr > 0) {
var imgsingle = "http://192.168.0.1/webcam/webcam.jpeg";

document.imgroom.src = imgsingle;
setTimeout("changeit()",3000);
}
}
//end hide -->
</script>

</head>
<body text="#000066" bgcolor="#FFFFFF" link="#0066FF" vlink="#00AAFF"
alink="#FF0000" onload="changeit()">

<center>
<IMG src="" name="imgroom" alt="Picture" height=240 width=320></img>
</center>
</body>
</html>


If you go to this url in your browser do you see an image at
http://192.168.0.1/webcam/webcam.jpeg?

Mike


Hi,
I guess it's on his private network and not viewable to us.

For test purposes I modified the code slightly to see what I could see.
With the modified changeit() below and 2 images in the same directory as my
html,
I see the alt "text" incrementing and the pictures swapping every 3 seconds.

As noted in other posts, it is always helpful to provide
a more detailed description than "not working".

function changeit() {
if (chgcntr++ > 0) {
var imgsingle0 = "catnglasses.jpg";
var imgsingle1 = "catnfood.jpg";

if (chgcntr % 2 == 0) document.imgroom.src = imgsingle0;
else document.imgroom.src = imgsingle1;

document.imgroom.alt=chgcntr;
setTimeout("changeit()",3000);
}
}

Jul 20 '05 #5

P: n/a
Bartosz Wegrzyn wrote:
Thanks for your help, but unfortunetaly even you code did not work.
I erased the htm file and I created a new one and it helped.


Okay, what was it that made it work?

Jul 20 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.