Your Universal Remote Control Center
RemoteCentral.com
Philips Pronto Professional Forum - View Post
Up level
Up level
The following page was printed from RemoteCentral.com:

Login:
Pass:
 
 

Original thread:
Post 8 made on Thursday June 24, 2010 at 13:43
pjjameso
Long Time Member
Joined:
Posts:
April 2008
73
Next question regarding multiple swa alerts, hoping its a quick modification! In the code below I am receiving multiple swa's from weather.com. Im am displaying the first alert of the three recieved below correctly. How would one loop to pick up the remaining alerts since they all seem to have the same xml tag?


 //<swa>
- <a id="628896" uc="1">
  <t>Special Weather Statementt>
  <l>[Link: weather.com]l>
  a>
- <a id="618609" uc="0">
  <t>Air Quality Alertt>
  <l>[Link: weather.com]l>
  a>
- <a id="636930" uc="1">
  <t>Severe Thunderstorm Watch until Thu Jun 24 2010 08:00 PM EDTt>
  <l>[Link: weather.com]l>
  a>
  swa>\\

// Display Severe Weather Alert
try {
var swa = weather.swa.a[0].t;
}
catch (e) {
var swa = "";
}

CF.widget("SWA").label = swa;
//System.print("Severe Weather Alert: " +swa);

Thanks as always!

Last edited by pjjameso on June 24, 2010 13:52.
Paul


Hosting Services by ipHouse