View Full Version : rss pausescroller : Need to remove \n

12-09-2009, 03:26 AM
1) Script Title: rss pausescroller

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex17/rsspausescroller/

3) Describe problem: This might be quite simple but I just can't figure it out without getting javascript errors left and right. As you know when it displays a feed entry it will display the entry and then the date it was added. However I'm trying to get rid of the \n (new line) so that the feed and date remains on 1 line.

So instead of this:

Feed entry 1
Dec 9, 2009 1:2 AM

I would like it to display this:
Feed entry 1 - Dec 9, 2009 1:2 AM

Thanks for anyone who can figure this out because I sure cant :)

12-09-2009, 05:22 AM
Find this near the top of the rsspausescroller.js file:

//Advanced users: Edit below function to format the RSS feed output as desired
//formatrssmessage(divid, message_index_within_array, linktarget, logicswitch)

function formatrssmessage(divid, msgnumber, linktarget, logicswitch){
var rsscontent=rsscontentdata[divid][msgnumber]
var linktitle='<span class="rsstitle"><a href="'+unescape(rsscontent.link)+'" target="'+linktarget+'">'+unescape(rsscontent.title)+'</a></span>'
var description='<div class="rssdescription">'+unescape(rsscontent.description)+'</div>'
var feeddate='<span class="rssdate">'+unescape(rsscontent.date)+'</span>'
if (logicswitch.indexOf("description")!=-1 && logicswitch.indexOf("date")!=-1) //Logic switch- Show description and date
return linktitle+"<br />"+feeddate+description
else if (logicswitch.indexOf("description")!=-1) //Logic switch- Show just description
return linktitle+"<br />"+description
else if (logicswitch.indexOf("date")!=-1) //Logic switch- Show just date
return linktitle+"<br />"+feeddate
return linktitle //Default- Just return hyperlinked RSS title

//////NO NEED TO EDIT BEHIND HERE///////////////////////////

Change the highlighted line to:

return linktitle+" - "+feeddate+description

12-09-2009, 05:44 AM
Many thanks! Works :)