Spry scoreboard using xml not updating in internet explorer.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Richard OBrien
    New Member
    • Nov 2010
    • 2

    Spry scoreboard using xml not updating in internet explorer.

    Hi Guys,

    I used an example from adobe.com to make a spry scoreboard that automatically updates the scores from an xml document. I took it futher and have had some success, but when I put it live I found out that it will not update in internet explorer unless clearing history, or opening a new tab then going back.

    It works great in firefox and safari, and will update as soon as I change the xml, then upload to my server. Any help would be greatly appreciated. I have searched long and hard for a solution, and it looks like I.E caching may be the culprit. How to get around this though I do not know.

    I have put up the demo files from the example as it has the same issue regarding I.E

    Thank you!!



    Rich

    http://www.richyobrien .com/spry_scoreboard/my_scores.html

    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
    [
         <!ENTITY % SPRY SYSTEM "http://www.adobe.com/dtd/spry.dtd">
         %SPRY;
    ]>
    <html xmlns="http://www.w3.org/1999/xhtml" xmlns:spry="http://ns.adobe.com/spry">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
    <title>My Score Board</title>
    <style type="text/css">
    html, body {
         font-size:0px;
         margin:0px;
         padding:0px;
    }
    *html, *body {
         margin-top:-2px;
    }
    .games {
         font-size:12px;
         font-family:Arial;
         color:#000;
    }
    .SpryHiddenRegion {
         display: none;
    }
    </style>
    <script language="JavaScript" type="text/javascript" src="xpath.js"></script>
    <script language="JavaScript" type="text/javascript" src="SpryData.js"></script>
    <script language="JavaScript" type="text/javascript" src="SpryEffects.js"></script>
    <script type="text/javascript">
    <!--//
    var dsGames = new Spry.Data.XMLDataSet("games.xml", "games/game"); // Load the Overall Game information
    var dsHome = new Spry.Data.XMLDataSet("games.xml", "/games/game/home", { subPaths: ["teamStats", "teamStats/score" ], useCache:false, loadInterval:3000}); // Load all of the Home Team Information
    var dsAway =new Spry.Data.XMLDataSet("games.xml", "/games/game/away", { subPaths: ["teamStats", "teamStats/score" ], useCache:false, loadInterval:3000}); // Load all of the Away Team Imformation
    
    var HScoreHolder = new Array(); // Home Score Holder
    var AScoreHolder = new Array(); // Away Score Holder
    var scoreHolder = new Array(); // Generic Score Holder
    
    function GetScoreUpdateFunc(scoreHolder, prefixStr){ // Get score function
         return function (ds, row, rowIndex){ // return the actual filter function
              
              var key = prefixStr+row['teamStats/score/@quarter']; // create a key for the games          
              
              if(scoreHolder[key]){ // check for keys already set
                   if(row['teamStats/score'] != scoreHolder[key]){ // check to see if the scores match. If they don't, then show the update
                        Spry.Effect.DoHighlight(key,{duration:3000,from:'#FB9A00', to:'#fff', restoreColor:'#fff'});// highlight the updated score box
                   }
              }
              
              scoreHolder[key]= new Array(); // make each key an array
              scoreHolder[key]= row['teamStats/score']; // get the current scores
              return row; // return the regular dataset
         };
    }
    
    
    dsHome.filter(GetScoreUpdateFunc(HScoreHolder, "hq_")); // Filter for home scores... Check for updates
    dsAway.filter(GetScoreUpdateFunc(AScoreHolder, "aq_")); // Filter for away scores... Check for updates
    
    //-->
    
    </script>
    </head>
    <body>
    <div class="games SpryHiddenRegion" spry:detailregion="dsGames dsHome dsAway">
      <h1>{dsGames::location}</h1>
      <table cellpadding="0" cellspacing="0" border="1">
        <tr>
          <th>&nbsp;</th>
          <th spry:repeat="dsHome">{dsHome::ds_RowNumberPlus1}</th>
          <th>Time Outs Used</th>
    
          <th>Foul Trouble</th>
        </tr>
        <tr>
          <td>{dsHome::teamName}</td>
          <td spry:repeat="dsHome" id="hq_{dsHome::teamStats/score/@quarter}">{dsHome::teamStats/score}</td>
          <td>{dsHome::teamStats/@timeOuts}</td>
          <td>{dsHome::teamStats/@foulTrouble}</td>
    
        </tr>
        <tr>
          <td>{dsAway::teamName}</td>
          <td spry:repeat="dsAway" id="aq_{dsAway::teamStats/score/@quarter}">{dsAway::teamStats/score}</td>
          <td>{dsAway::teamStats/@timeOuts}</td>
          <td>{dsAway::teamStats/@foulTrouble}</td>
        </tr>
    
      </table>
    </div>
    </body>
    </html>
  • Richard OBrien
    New Member
    • Nov 2010
    • 2

    #2
    Success

    I got some fantastic help on the adobe forums and it's now working great. This was Fabio's answer:

    "I solved it adding this bit of code : method:'POST' as in the example below.

    Code:
    var live_status = new Spry.Data.XMLDataSet("feeds/feed_presence2.xml", "root/row", {useCache:false,loadInterval: 200000, [B]method:'POST'[/B]})
    According to what I read in this forum, using POST will force IE to not cache the data.

    Hope it helps."

    Comment

    Working...