Results 1 to 6 of 6

Thread: RSS Ticker (Ajax invocation) problem when there is no description to show

  1. #1
    Join Date
    Sep 2007
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default RSS Ticker (Ajax invocation) problem when there is no description to show

    1) Script Title: Advanced RSS Ticker (Ajax invocation)

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...ajax/index.htm

    3) Describe problem: Problem with no description in RSS feed causing ticker to not initialize.

    I have been running the BBC UK football RSS feed (hxxp://newsrss.bbc.co.uk/rss/sportonline_uk_edition/football/rss.xml) fine for about a week. Then it starts to fail, with the error 'Initializing ticker'.

    Having talked to my host provider who has investigated, the access to the link is fine. However, there is currently no description for one item in the RSS feed. And I think this must cause the script to not work.

    Has anyone else had this problem? I wouldn't have thought that many RSS feeds have a title with no description! Can anyone else get the RSS feed listed above to work / ideas to fix the bug if it is a bug?

    Any help much appreciated!

    Thanks

    Tom

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

    Default

    This script does assume that each entry within the feed contains a description element, even if it's blank. Anyhow, try changing the below line:

    Code:
    this.description[i]=this.feeditems[i].getElementsByTagName("description")[0].firstChild.nodeValue
    to:

    Code:
    var dnode=this.feeditems[i].getElementsByTagName("description")
    this.description[i]=(dnode.length==1)? dnode[0].firstChild.nodeValue : ""
    That should compensate for when an entry has no description element at all.

  3. #3
    Join Date
    Sep 2007
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Hi

    I've tested the extra code you suggested, and although the other rss feeds work okay still, the BBC feed with no description still doesn't work.

    I'm not sure if this means that the script won't work with no description or there is something else wrong somewhere!

    Do you have any other ideas?

    Thanks for getting back with the mod though! Much appreciated.

    Thanks

    Tom

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

    Default

    Please post a link to the page on your site that contains the problematic script so we can check it out.

  5. #5
    Join Date
    Sep 2007
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default SIte details:

    Original rssticker.js:

    http://www.scor eabet.com/test/rss.htm - 2 feeds - the BBC video sport feed that works, and the BBC sport feed (http://newsrss.bbc.co.uk/rss/sporton...otball/rss.xml) that has no description for 1 of it's news feeds.

    http://www.scor eabet.com/test/rss2.htm - Just the 1 feed that doesn't work.

    Revised rssticker2.js code (as per prior post)

    http://www.scor eabet.com/rss/rss.htm - 2 feeds
    http://www.scor eabet.com/rss/rss2.htm - 1 feed that doesn't work



    I've tried running just the revised script on my server, just in case it was an issue with the cache directory, but deleting the original script and running the revised script didn't seem to work either.

  6. #6
    Join Date
    Jun 2008
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    i have the same problem

    here is the feed url
    http://newsrss.bbc.co.uk/rss/arabic/...t_news/rss.xml

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
  •