SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Enthusiast
    Join Date
    Jun 2002
    Posts
    42
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    script working inside of document, but not externally

    I have to scripts on this page: connectingauthors.com (the photo scroller and quote ticker)
    If I try to the quote ticker outside the page it doesn't work.
    I tried both putting the whole script in 1 file (javascript.js), and I tried splitting the head and body into 2 files like below: (I took out most quotes for shortening)
    I am new at Javascript, and any help would be appreciated.
    Code:
    <head>
    .....stuff here....
     <SCRIPT LANGUAGE="JavaScript" SRC="includes/javascript.js"> </SCRIPT>
    </head>
    <body>
    <SCRIPT LANGUAGE="JavaScript" SRC="http://www.connectingauthors.com/includes/quote_ticker.js"> </SCRIPT>
    Javascript.js:
    Code:
    <script type="text/javascript">
    
    //                                    **************QUOTE TICKER*************
    var tickercontent=new Array()
    tickercontent[0]='<em>\"Author\'s day was wonderful.  Jan is an amazing guy!  So warm and down-to-earth!</em>  -Kate Chassman, parent at San Ramon in Novato, CA about Jan Adkins\"'
    tickercontent[1]='<em>\"We really loved Gianna\'s visit on Monday!  About 70 kids at Cureton got to enjoy a great presentation, learn to draw animals, make an alphabet book, and play alphabet books.  We had so much fun!  Thank you for making this possible.\"</em> -Lisa Zhang'
    tickercontent[2]='<em> \"Thank you so much for bringing them to our school, we loved it!\" </em> -Erika Pollard, 2nd grade teacher'
    tickercontent[3]='<em> \"Elmwood will always welcome your authors with open arms and eager smiles. Thank you again. \" </em> -Sandra Mulvihill'
    tickercontent[4]='<em> \" ...the day went fantastically well. Dave was a terrific guest author. This is the 11th year we have held this event and Dave was one of the best authors we have had. His ability to relate to all of our students K through 5th was amazing. And the teachers loved his presentations as well. Dave will be a hard act to follow next year. \"</em> -Karen Ott '
    tickercontent[5]='<em> \"They still haven\'t stopped talking about her she had them so engrossed in her stories for such a long time...I was so impressed. She already \"had them at hello \" \" </em> -Ron Russo about Caryn Yacowitz'
    
    </script>
    quote_ticker.js:
    Code:
    // JavaScript Document
     <script type="text/javascript">
    
    
    
    //new domticker(name_of_message_array, CSS_ID, CSS_classname, pause_in_miliseconds, optionalfadeswitch)
    
    new domticker(tickercontent, "domticker", "someclass", 4500, "fadeit")
    document.write("<br />")
    </script>

  2. #2
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,729
    Mentioned
    104 Post(s)
    Tagged
    4 Thread(s)
    Your script files should contain only script code.
    It looks like you've included the HTML script tags in with the script code. They will not work until the script tags are taken out of the script code.
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript

  3. #3
    SitePoint Enthusiast
    Join Date
    Jun 2002
    Posts
    42
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm not sure where you mean... the top code is what is in the html file, the second 2 are the js files.
    Could you explain where you mean?
    Thank You

  4. #4
    SitePoint Enthusiast
    Join Date
    Jun 2002
    Posts
    42
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    do you mean
    <script type="text/javascript">?

  5. #5
    SitePoint Enthusiast
    Join Date
    Jun 2002
    Posts
    42
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    got it!!! Thanks!!


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
  •