SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Guru
    Join Date
    Sep 2001
    Location
    Vancouver
    Posts
    809
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Need help debugging simple script

    Hi,

    We got this script in class today and we have to debug it. I have no idea what's wrong with it. Any help would be greatly appreciated:
    PHP Code:
    <SCRIPT LANGUAGE="JavaScript">
    <!--
        var 
    delayAA 150;
        var 
    messageAA "Type your message here.";
        var 
    timerAA 0;
        var 
    alignRightAA 0;
        while (
    alignRightAA++<120)messageAA " " messageAA;
        function 
    BannerAA()
        {
    window.status=messageAA.substring(timerAA++,messageAA.length);
        if (
    timerAA == messageAA.lengthtimerAA 0;
        
    setTimeOut("BannerAA()"delayAA;}
        
    BannerAA();
        
    //-->
    </SCRIPT> 
    It's supposed to display scrolling text in the status bar.

  2. #2
    SitePoint Zealot
    Join Date
    Oct 2003
    Location
    USA
    Posts
    173
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    At first glance, it looks like there is a missing ) at the end of this line:
    while (alignRightAA++<120)messageAA = " " + messageAA;
    .
    2 | 3 | 4 | 5 | 6 | 7 | 8 | 9
    2 | 3 | 4 | 5 | 6 | 7 | 8 | 9
    2 | 3 | 4 | 5 | 6 | 7 | 8 | 9

  3. #3
    SitePoint Wizard silver trophy
    Join Date
    May 2003
    Posts
    1,843
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    setTimeout("BannerAA()", delayAA);}

    Missing a parenthesis after setTimeout function, which has one capital letter.
    How will you learn anything by asking us to debug for you?
    ::: certified wild guess :::

  4. #4
    SitePoint Guru
    Join Date
    Sep 2001
    Location
    Vancouver
    Posts
    809
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank your for your help. The reason why I asked here is because we haven't even begun to learn JavaScript and he just gave us that question. Nobody could figure it out, thanks for your help again.

  5. #5
    SitePoint Wizard silver trophy
    Join Date
    May 2003
    Posts
    1,843
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ::: certified wild guess :::


Bookmarks

Posting Permissions

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