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 1 made on Saturday May 29, 2010 at 14:31
pjjameso
Long Time Member
Joined:
Posts:
April 2008
73
I have captured and displayed sucessfully the text data from weather.com. Problem is when there isnt a swa (Severe Weather Alert) the xml tag in the data feed is not present and I get the following error in my prontoscript.

ProntoScript error: TypeError: weather.swa.a[0] has no properties

I assume an if statement could test whether there is data or not but am a bit stumped as to how to test. Any suggestions out there? Below is the snippet of code that is causing the problem.

// 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 in advance...

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


Hosting Services by ipHouse