1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Need Help With Javascript

Discussion in 'HTML & JavaScript' started by The Scarlet Pimp, Jan 26, 2009.

  1. The Scarlet Pimp

    The Scarlet Pimp Senior Member

    Joined:
    Apr 2, 2008
    Messages:
    848
    Likes Received:
    3,239
    Occupation:
    Chair moistener.
    Location:
    Cyberspace
    which one of these is correct? :confused:


    #1. else
    {
    new rsspausescroller("funny", "pscroller1", "rssclass", 3000, "")
    document.write(rss);
    }


    Or...


    #2. else
    new rsspausescroller("funny", "pscroller1", "rssclass", 3000, "")
    document.write(rss);


    They both seem to work, but I'm not sure if I'm supposed to use the braces or
    leave them out...
     
  2. The Scarlet Pimp

    The Scarlet Pimp Senior Member

    Joined:
    Apr 2, 2008
    Messages:
    848
    Likes Received:
    3,239
    Occupation:
    Chair moistener.
    Location:
    Cyberspace
    this is the tute that i was using, (some of the instructions are different):
    http://www.webdevelopersnotes.com/tutorials/javascript/javascript_if_else_statement.php3


    which one of these is correct? one guide says to write it the first way, but another guide says to
    write it the second way.


    1. else {if (rss == 3) {new rsspausescroller("scan", "pscroller1", "rssclass", 8000, "")};};

    Or...

    2. else if (rss == 3)
    {
    new rsspausescroller("scan", "pscroller1", "rssclass", 8000, "");
    }
     
    Last edited: Jan 26, 2009
  3. The Scarlet Pimp

    The Scarlet Pimp Senior Member

    Joined:
    Apr 2, 2008
    Messages:
    848
    Likes Received:
    3,239
    Occupation:
    Chair moistener.
    Location:
    Cyberspace
    never mind... i think i got this one... :D