Recent Widgets

Register for DashboardWidgets

Recent Forums Posts



RSS Showcase
RSS Comments
RSS Forums

This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies. Posted in: Widget Central

Multiple RSS Feed Widget

Author Message

Joined: 25 Jul 2005
Posts: 1
Location: USA

Posted: Mon Jul 25, 2005 - 11:07 am    Post subject: Multiple RSS Feed Widget Reply with quote

Hey everyone,
I'm having some trouble with a widget I am working on right now. It's a simple little widget that uses XMLHttpRequest to get the current contents of a php file. The widget is working fine with 1 feed, but what I want to do is have a preference menu on the back where users can select one of 3 feeds they want to view. All my attempts thus far have failed, and I'm kinda at a loss for what to try next. All I need this thing to do is change a variable to the user-selected feed! Here's some of the code I have so far:


<body onload="loadXMLDoc()">

      <div id="widget" onmousemove='mousemove(event);' onmouseout='mouseexit(event);'>
        <div id="switch"></div>
        <div id="T1" class="left_news"></div>
        <div id="right_rss" onclick="txtlink();"></div>
      <div class='flip' id='fliprollie'></div>
      <div class='flip' id='flip' onclick='showPrefs(event);' onmouseover='enterflip(event);' onmouseout='exitflip(event)';></div>

        <div id="back_widget">
        <img span="backgroundImage" src="Backside.png">
         <form name='feedURL' action='javascript:saveURLPref();'>
         <select name="feedURL">
         <option value="">News</option>
         <option value="">Articles</option>
         <option value="">Both</option>
        <img class="doneButton" src="Done.png" onclick='hidePrefs()' />

JS File

function loadXMLDoc()

    var url = widget.preferenceForKey("rssFeedurl");
    if (url && url.length > 0)
        urlText.innerText = urlString;

    xmlhttp = new XMLHttpRequest();
    xmlhttp.onreadystatechange = processReqChange;"GET", url, true);
    xmlhttp.setRequestHeader("Cache-Control", "no-cache");

function processReqChange() {
    // only if xmlhttp shows "loaded"
    if (xmlhttp.readyState == 4) {
        // OK
        if (xmlhttp.status == 200) {
        } else {
            alert("Connection to the news server has failed:\n" + req.statusText);

widget.onshow = function() {



function saveURLPref(){
   if (window.widget){
      widget.setPreferenceForKey(document.feedURL.feedURL.value, rssFeedurl);

loadXMLDoc is called when the <body> of the widget is opened.

Thanks a ton!
View user's profile Send private message Send e-mail Visit poster's website AIM Address Widgets
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.

Powered by phpBB © 2001, 2002 phpBB Group