PDA

View Full Version : HTML characters being shown in pausing RSS scroller



sdasevne
12-17-2006, 02:32 PM
Script: RSS Pause Scoller

http://www.dynamicdrive.com/dynamicindex17/rsspausescroller/index.htm

I tried installing the demo on my site at www.darlindolphins.com/rss.htm, but the news item descriptions contain extraneous "<a" and "<p" and "srce=" and other html. If I change the rss to BBC instead of CNN, it seems to work OK. I'd rather display domestic news stories instead of British ones, however.

sdasevne
12-18-2006, 02:03 PM
I even tried running the demo page at 2 different hosts, and they behave the same way; they display the html code after the description. Is there any way to make the script stop generating code after it reaches the end of the news item? Like just display "read the full story for details" and then stop writing stuff like this: <p><a href="http://rss.cnn.com/~a/rss/cnn_topstories?a=ZPOmyC"><img src="http://rss.cnn.com/~a/rss/cnn_topstories?i=ZPOmyC" border="0"></img></a></p><img src="http://rss.cnn.com/~r/rss/cnn_topstories/~4/63217831"/>

Please take a look at www.darlindolphins.com/rss.htm to see what I mean. I made no changes to any of the files, just loaded them to my host, and the CNN items look awful.

ddadmin
12-18-2006, 09:01 PM
Firstly, please note that I've moved your posts into a new thread. You were replying to someone else's thread, which you shouldn't do if you're asking a question of your own.

Hmm I can't tell immediately why the script is displaying the HTML tags literally for the description portion of the CNN feed. To get the script to just display "read the full story for details" for the descriptions, change the line:


var description='<div class="rssdescription">'+unescape(rsscontent.description)+'</div>'

inside rsspausescroller.js to:


var description='<div class="rssdescription">read the full story for details</div>'

I'll have to go back and confirm if the HTML literals problem occurs in the DD demo as well.

sdasevne
12-18-2006, 10:07 PM
I tried truncating the description before the first "<p>", but that didn't help. I added these statements:

var ix = description.indexOf("<p>");
if (ix >= 30) description = description.substring(0,ix-1);

Does anyone else have any suggestions on why the first rss box (CNN) displays the unwanted html, while the second box (BBC) seems to work OK? Has anyone successfully implemented this script using CNN feed, with the "description + date" option?

Thanks.

sdasevne
12-20-2006, 12:39 AM
It appears that the RSS Pause Scroller script does not handle the CNN feed correctly. If you look at the sample page at www.darlindolphins.com/rss.htm, showing a CNN scrolling box, a BBC scrolling box, and a Fox scrolling box, you will see that the Fox and BBC feeds look OK, but the CNN feed shows the html characters. Probably CNN is using a different standard than the other two. The solution to my problem is to change from the CNN feed to FOX. The documentation for this script should be updated to indicate that CNN RSS feeds will not work correctly if the "description+date" option is used.