Results 1 to 4 of 4

Thread: Ajax XML Ticker & junk after document elem

  1. #1
    Join Date
    Jan 2010
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Ajax XML Ticker & junk after document elem

    Is there any way to get rid of the following error:
    junk after document element
    ...
    <div class="message">
    ^
    Ajax XML Ticker can be executed at:
    http://www.dynamicdrive.com/dynamici...ajaxticker.htm

    Thank you.

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Yes. Instead of following the exact syntax for your external text file, use this template (additions highlighted):

    Code:
    <!-- Wrap each ticker cotent inside <div class="message"> tag -->
    <div>
    <div class="message">
    <a href="http://www.javascriptkit.com" target="_new">JavaScript Kit</a><br />Comprehensive JavaScript tutorials and over 400+ free scripts!
    </div>
    
    <div class="message">
    <a href="http://www.codingforums.com">Coding Forums</a><br />Web coding and development forums.
    </div>
    
    <div class="message">
    <a href="http://www.cssdrive.com">CSS Drive</a><br />Categorized CSS gallery and examples.
    </div>
    
    <div class="message">
    <a href="http://www.javascriptkit.com/domref/">DOM Reference</a><br />This is a no-nonsense, easy to follow DOM reference for JavaScript.
    </div>
    </div>
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    Interesting John, can you explain why that fixes the error?
    DD Admin

  4. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    I'm thinking it's most likely as the error itself tends to indicate. Firefox, possibly others, not IE (which gives no error because it sees the response text as text only) report this as like:

    junk after document element
    So I thought, what document? It's an xml document right? Well an xml document must have an overall opening and closing tag. In xml it doesn't matter what the tag is. Tags in xml may be user defined. But since we are importing this to an HTML document, may as well use a tag that will be valid there as well.

    Without an overall opening and closing tag, Firefox sees the first tag as the entire document, with the other div tags as "junk".
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

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
  •