JAVASCRIPT recusive function

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Bartosz Wegrzyn

    JAVASCRIPT recusive function

    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>Javascri pt Webcam for Internet Explorer</title>
    <meta http-equiv="Content-Type" content="text/html;
    charset=iso-8859-1">

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

    currentdate = new Date();
    currenttime = currentdate.get Time();


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

    document.imgroo m.src = imgsingle;
    setTimeout("cha ngeit()",3000);
    }
    }
    //end hide -->
    </script>

    </head>
    <body text="#000066" bgcolor="#FFFFF F" link="#0066FF" vlink="#00AAFF"
    alink="#FF0000" onload="changei t()">

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


    </center>
    </body>
    </html>


    Thanks
  • mscir

    #2
    Re: JAVASCRIPT recusive function

    Bartosz Wegrzyn wrote:[color=blue]
    > 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>Javascri pt Webcam for Internet Explorer</title>
    > <meta http-equiv="Content-Type" content="text/html;
    > charset=iso-8859-1">
    >
    > <script LANGUAGE="JavaS cript">
    > <!-- hide from old browsers
    > var chgcntr=1;
    >
    > currentdate = new Date();
    > currenttime = currentdate.get Time();
    >
    >
    > function changeit() {
    > if (chgcntr > 0) {
    > var imgsingle = "http://192.168.0.1/webcam/webcam.jpeg";
    >
    > document.imgroo m.src = imgsingle;
    > setTimeout("cha ngeit()",3000);
    > }
    > }
    > //end hide -->
    > </script>
    >
    > </head>
    > <body text="#000066" bgcolor="#FFFFF F" link="#0066FF" vlink="#00AAFF"
    > alink="#FF0000" onload="changei t()">
    >
    > <center>
    > <IMG src="" name="imgroom" alt="Picture" height=240 width=320></img>
    >
    >
    > </center>
    > </body>
    > </html>[/color]

    If you go to this url in your browser do you see an image at


    Mike

    Comment

    • Chris Crandell

      #3
      Re: JAVASCRIPT recusive function


      mscir <mscir@access4l ess.net> wrote in message
      news:102qpheg2g 26457@corp.supe rnews.com...[color=blue]
      > Bartosz Wegrzyn wrote:[color=green]
      > > 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>Javascri pt Webcam for Internet Explorer</title>
      > > <meta http-equiv="Content-Type" content="text/html;
      > > charset=iso-8859-1">
      > >
      > > <script LANGUAGE="JavaS cript">
      > > <!-- hide from old browsers
      > > var chgcntr=1;
      > >
      > > currentdate = new Date();
      > > currenttime = currentdate.get Time();
      > >
      > >
      > > function changeit() {
      > > if (chgcntr > 0) {
      > > var imgsingle = "http://192.168.0.1/webcam/webcam.jpeg";
      > >
      > > document.imgroo m.src = imgsingle;
      > > setTimeout("cha ngeit()",3000);
      > > }
      > > }
      > > //end hide -->
      > > </script>
      > >
      > > </head>
      > > <body text="#000066" bgcolor="#FFFFF F" link="#0066FF" vlink="#00AAFF"
      > > alink="#FF0000" onload="changei t()">
      > >
      > > <center>
      > > <IMG src="" name="imgroom" alt="Picture" height=240 width=320></img>
      > >
      > >
      > > </center>
      > > </body>
      > > </html>[/color]
      >
      > If you go to this url in your browser do you see an image at
      > http://192.168.0.1/webcam/webcam.jpeg?
      >
      > Mike
      >[/color]

      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.jp g";
      var imgsingle1 = "catnfood.j pg";

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

      document.imgroo m.alt=chgcntr;
      setTimeout("cha ngeit()",3000);
      }
      }


      Comment

      • mscir

        #4
        Re: JAVASCRIPT recusive function


        Chris Crandell wrote:[color=blue]
        > mscir <mscir@access4l ess.net> wrote in message
        > news:102qpheg2g 26457@corp.supe rnews.com...
        >[color=green]
        >>Bartosz Wegrzyn wrote:
        >>[color=darkred]
        >>>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>Javas cript Webcam for Internet Explorer</title>
        >>><meta http-equiv="Content-Type" content="text/html;
        >>>charset=is o-8859-1">
        >>>
        >>><script LANGUAGE="JavaS cript">
        >>><!-- hide from old browsers
        >>>var chgcntr=1;
        >>>
        >>>currentdat e = new Date();
        >>>currenttim e = currentdate.get Time();
        >>>
        >>>
        >>>function changeit() {
        >>>if (chgcntr > 0) {
        >>>var imgsingle = "http://192.168.0.1/webcam/webcam.jpeg";
        >>>
        >>>document.img room.src = imgsingle;
        >>>setTimeout(" changeit()",300 0);
        >>>}
        >>>}
        >>>//end hide -->
        >>></script>
        >>>
        >>></head>
        >>><body text="#000066" bgcolor="#FFFFF F" link="#0066FF" vlink="#00AAFF"
        >>>alink="#FF00 00" onload="changei t()">
        >>>
        >>><center>
        >>><IMG src="" name="imgroom" alt="Picture" height=240 width=320></img>
        >>>
        >>>
        >>></center>
        >>></body>
        >>></html>[/color]
        >>
        >>If you go to this url in your browser do you see an image at
        >>http://192.168.0.1/webcam/webcam.jpeg?
        >>
        >>Mike
        >>[/color]
        >
        >
        > 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.jp g";
        > var imgsingle1 = "catnfood.j pg";
        >
        > if (chgcntr % 2 == 0) document.imgroo m.src = imgsingle0;
        > else document.imgroo m.src = imgsingle1;
        >
        > document.imgroo m.alt=chgcntr;
        > setTimeout("cha ngeit()",3000);
        > }
        > }[/color]


        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

        Comment

        • Bartosz Wegrzyn

          #5
          Re: JAVASCRIPT recusive function

          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" <ccrandel@ix.ne tcom.com> wrote in message news:<BwjXb.350 8$WW3.2911@news read2.news.pas. earthlink.net>. ..[color=blue]
          > mscir <mscir@access4l ess.net> wrote in message
          > news:102qpheg2g 26457@corp.supe rnews.com...[color=green]
          > > Bartosz Wegrzyn wrote:[color=darkred]
          > > > 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>Javascri pt Webcam for Internet Explorer</title>
          > > > <meta http-equiv="Content-Type" content="text/html;
          > > > charset=iso-8859-1">
          > > >
          > > > <script LANGUAGE="JavaS cript">
          > > > <!-- hide from old browsers
          > > > var chgcntr=1;
          > > >
          > > > currentdate = new Date();
          > > > currenttime = currentdate.get Time();
          > > >
          > > >
          > > > function changeit() {
          > > > if (chgcntr > 0) {
          > > > var imgsingle = "http://192.168.0.1/webcam/webcam.jpeg";
          > > >
          > > > document.imgroo m.src = imgsingle;
          > > > setTimeout("cha ngeit()",3000);
          > > > }
          > > > }
          > > > //end hide -->
          > > > </script>
          > > >
          > > > </head>
          > > > <body text="#000066" bgcolor="#FFFFF F" link="#0066FF" vlink="#00AAFF"
          > > > alink="#FF0000" onload="changei t()">
          > > >
          > > > <center>
          > > > <IMG src="" name="imgroom" alt="Picture" height=240 width=320></img>
          > > >
          > > >
          > > > </center>
          > > > </body>
          > > > </html>[/color]
          > >
          > > If you go to this url in your browser do you see an image at
          > > http://192.168.0.1/webcam/webcam.jpeg?
          > >
          > > Mike
          > >[/color]
          >
          > 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.jp g";
          > var imgsingle1 = "catnfood.j pg";
          >
          > if (chgcntr % 2 == 0) document.imgroo m.src = imgsingle0;
          > else document.imgroo m.src = imgsingle1;
          >
          > document.imgroo m.alt=chgcntr;
          > setTimeout("cha ngeit()",3000);
          > }
          > }[/color]

          Comment

          • mscir

            #6
            Re: JAVASCRIPT recusive function

            Bartosz Wegrzyn wrote:[color=blue]
            > 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.[/color]

            Okay, what was it that made it work?

            Comment

            Working...