Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Jan 2006
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    How can I make it work??

    I have this little scrip but I am missing something. I do not get any error but it does not work neither.
    Please help me make it work

    <script language="JavaScript">
    <!-- Begin
    var msg="I am flashing!";
    var speed=300;
    var visible=0;
    function Flash() {
    if (visible = 0) {
    window.status=msg;
    visible=1;
    } else {
    window.status=" ";
    visible=0;
    }
    setTimeout('Flash()', speed);
    }
    // End -->
    </script>

  • #2
    Senior Coder
    Join Date
    Mar 2005
    Location
    Portsmouth UK
    Posts
    4,536
    Thanks
    3
    Thanked 513 Times in 500 Posts
    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
        "http://www.w3.org/TR/html4/loose.dtd">
    
    <html>
    
    <head>
      <title></title>
    <script language="JavaScript">
    <!-- Begin
    
    var msg="I am flashing!";
    var speed=300;
    var visible=0;
    
    function Flash() {
     if (visible==0) {  // = is assign, == is compare
      visible=1;
      window.status=msg;
      return true; // return true is required to status message so set timeout will not be acessed
     }
     else {
      visible=0;
      window.status=" ";
      return true;
     }
    }
    
    function FlashSrt() {
     setInterval('Flash()', speed);
    }
    
    // End -->
    </script>}
    </head>
    
    <body onload="FlashSrt();">
    <p>
    </body>
    
    </html>


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •