PDA

View Full Version : Multiple feeds?



cvadnais
05-22-2007, 06:23 AM
1) Script Title: RSS Display Boxes

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

3) Describe problem: I'm a new scripter. (Duh.) :confused: I tried to use the javascript code twice in one page. Is that permitted? One works, the other does not. The one that doesn't work used to work fine -- until I added the second one. Now only the second one works. (The one that works comes first in the HTML code, incidentally.)

Here is the code I used. For this one I only want one RSS entry--the most recent--to show up. This is the one that currently works:

<script type="text/javascript">
var showbbc=new rssdisplaybox("AFN Hawaii", "rssid", "rssclass")
showbbc.set_items_shown(1) //show 1 entry from feed
showbbc.start() //Required: start script
</script>

And this is the one that used to work, until I added the one (above) to the page, higher up in the page HTML. For this one I want only three (or maybe five) feed entries, and I really only want titles:

<script type="text/javascript">
var showbbc=new rssdisplaybox("AFN Hawaii", "rssid", "rssclass")
showbbc.set_items_shown(3) //show 3 entries from feed
showbbc.start() //Required: start script
</script>

Any help on this would be greatly appreciated.

Fortunately, I have acopy of the page when it worked with the first script, and another copy of it with both scripts.

Only one script, working fine:
http://afnhawaii.net/index_rss.htm

Two scripts, only one of them works:
http://afnhawaii.net/index_rss_1.htm

I know I also need to clean up the CSS so it looks a little better.

Thanks for any help.

Chris Vadnais
chrisvadnais [at] mac [dot] com

cvadnais
05-22-2007, 10:12 AM
Had to change the variable. Duh.

Thanks. Here's how it works:

<script type="text/javascript">
var showbbc=new rssdisplaybox("AFN Hawaii", "rssid", "rssclass")
showbbc.set_items_shown(1) //show 1 entry from feed
showbbc.start() //Required: start script
</script>

Second one:

<script type="text/javascript">
var showbbc2=new rssdisplaybox("AFN Hawaii", "rssid", "rssclass")
showbbc2.set_items_shown(3) //show 3 entries from feed
showbbc2.start() //Required: start script
</script>