Results 1 to 4 of 4

Thread: How do I include two different instances of RSSdisplay box on same page

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

    Default How do I include two different instances of RSSdisplay box on same page

    1) Script Title: RSSdisplaybox

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

    3) Describe problem: I have a two column format online magazine. I wish to display a different RSS feed in each column. I have included each RSS feed reference in main.php and named each one uniquely. However, when I try to insert the script calling one feed in the first column then the script calling the second feed in the next column, I end up seeing the last feed called where I have specified but the first feed request just spins and spins without displaying anything.

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

    Default

    Did you make sure that each instance of the RSS ticker invocation code on your page contains a unique variable name? For example:

    Code:
    <script type="text/javascript">
    var showbbc=new rssdisplaybox("bbc", "bbcdiv", "someclass")
    showbbc.set_items_shown(10) //show 10 entries from feed
    showbbc.start() //Required: start script
    </script>
    
    <script type="text/javascript">
    var showcnn=new rssdisplaybox("bbc", "cnndiv", "someclass")
    showcnn.set_items_shown(10) //show 10 entries from feed
    showcnn.start() //Required: start script
    </script>
    The code in red is what I'm referring to as far as unique variable name. Notice the name in orange- they too must be unique, as they correspond to the ID of the generated DIV that will contain each RSS feed instance.

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

    Default

    Yes, I did. When the page loads, you see the first RSS feed start to load then the second RSS feed loads in its proper place in the second column but the first RSS feed shows the spinning wheel and just keeps spinning. Script example:

    First column:

    <script type="text/javascript">
    var showromanarch=new rssdisplaybox("romanarch")
    showromanarch.set_items_shown(10) //show 10 entries from feed
    showromanarch.start() //Required: start script
    </script>

    Second column:

    <script type="text/javascript">
    var showgames=new rssdisplaybox("games")
    showgames.set_items_shown(10) //show 10 entries from feed
    showgames.start() //Required: start script
    </script>

    In main.php:

    $rsslist=array(
    "romanarch" => "http://uoregon.edu/~mharrsch/romanwonders.rss",
    "games" => "http://uoregon.edu/~mharrsch/ancientgames.rss",
    "scholars" => "http://uoregon.edu/~mharrsch/rscholars.rss",
    "acadpres" => "http://uoregon.edu/~mharrsch/academicpres.rss" //no trailing comma after last RSS URL!!

    Maybe I didn't wait long enough but it kept spinning even after several minutes. If I use the script just in column 1 romanarch.rss displays really quickly. Likewise, if I use the script in just column 2 ancientgames.rss displays really quickly.

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

    Default

    Did you remember to pass in a unique ID for each RSS instance? In your code posted above you didn't do that:

    Code:
    var showromanarch=new rssdisplaybox("romanarch", "missingid", "missingclass")

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
  •