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 2 made on Sunday May 30, 2010 at 01:39
Lyndel McGee
RC Moderator
Joined:
Posts:
August 2001
12,997
I think this might just work... What you want to do here is a check to see if the swa object exists using the known fact that javascript objects are sparsely populated arrays.

There are several ways to do this.
var swa = null;
if (weather['swa'])
{
swa = weather.swa.a[0].t;
}

OR

if (weather.hasOwnProperty('swa'))
{
swa = weather.swa.a[0].t;
}

The 2nd one, you can read about on google or the mozilla site as well as in Flanagan.
Lyndel McGee
Philips Pronto Addict/Beta Tester


Hosting Services by ipHouse