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 3 of 3
  1. #1
    New to the CF scene
    Join Date
    May 2007
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    removing empty <script> </script> in header breaks script

    http://maps.avnwx.com/scrolltest.html

    you'll see simple html page which displays vertically scroll text... the JS file is included at js/scroller.js.

    scrolltest.html HEAD is two lines:
    Code:
       <script src="js/scroller.js" type="text/javascript"/>
       <script  type="text/javascript"></script>
    The BODY includes script to actually initialize and invoke the scroller:
    Code:
         hello
        <div id='myscroller'></div>    
        <script type="text/javascript">
          //<![CDATA[
          var content='<font face="Arial" color="blue" style="font-size:12px;">'+
                      'This is the first line of text<br/>'+
                      'This would be the second<br/>'+
                      'This is a longer line of text which, because it is longer'+
                      ' than the "scroller width" in the scroller.js, it will'+
                      ' wrap somewhere.<br/>'+
                      'This would be the last one.'+
                      '</font>';
          startScroll("myscroller", content);
          //]]>
        </script>
        there
    My problem -- question -- If I simply remove the second line from the HEAD... the otherwise empty <script>...</script> line... The page fails to work.

    In Safari it works okay, but in Firefox I only see the word "there": no scrolling list, no errors in firebug. (That word, "there", is included directly in the body of the HTML file, and would normally appear after the scrolling list.

    Also, if (rather than delete) I merely switch the order of the two lines in HEAD, the page will fail in the same manner in firefox.

    Thoughts?

    -Peter Buckner

  • #2
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    17,730
    Thanks
    202
    Thanked 2,508 Times in 2,486 Posts
    Change it to

    <script type="text/javascript" src="js/scroller.js"></script>

  • #3
    New to the CF scene
    Join Date
    May 2007
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    yes, it does, of course.

    Thanks for the extra pair of eyes. Now I can continue to improve my scroller.

    -Peter Buckner


  •  

    Posting Permissions

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