[Javascript] Re: Parsing XML terror alert level

Ben Mauer me at telephag.nu
Mon May 16 18:46:24 CDT 2005


Hey all,

I want to make a web page that has the live terror alert level on it.

There's a ridiculously simple XML feed provided by Homeland Security at

http://www.dhs.gov/dhspublic/getAdvisoryCondition

That has the code

<?xml version="1.0" encoding="UTF-8"?>
<THREAT_ADVISORY CONDITION="ELEVATED" />

Basically I'd like some kind of JavaScript that parses that file, pulls 
out the condition, and puts it into a variable, say "alert_status". I 
then need to take the value of "alert_status" and use an if loop to 
match it.

I'm pretty much a JavaScript newbie and know what needs to happen on a 
functional level, but have no idea about implementation.

Thanks,

Ben




More information about the Javascript mailing list