[GRLUG] trouble extracting from XML (Ajax)

Eric Beversluis ebever at researchintegration.org
Fri Feb 4 07:34:52 EST 2011


Hi. Is there anyone out there who can make sense of JavaScript?

I'm trying to do some AJAX and having trouble getting some of the fields
out of the responseXML.

Is there some Javascript gotcha that I don't know about that explains
why the first line below works fine, but I keep getting nothing from my
XML with the second line?


   repParty[i] = Reps[i].getAttribute("party");
   repCongrID[i] = Reps[i].getAttribute("govtrack_id");

I don't seem to be able to retrieve data from any of the tagnames that
have underscores. I've also tried with 'fec_id' and 'in_office'. I tried
escaping the underscore, replacing it with a space, eliminating it all
together...

Thanks.

Eric

Here's a bit of the xml as it came to my phpproxy:
<pre>
−
<response>
−
<legislators>
−
<legislator>
<website>http://fudge.house.gov/</website>
<fax>202-225-1339</fax>
<govtrack_id>412327</govtrack_id>
<firstname>Marcia</firstname>
<chamber>house</chamber>
<middlename>L.</middlename>
<lastname>Fudge</lastname>
<congress_office>1513 Longworth House Office Building</congress_office>
<eventful_id/>
<phone>202-225-7032</phone>
<webform>https://forms.house.gov/fudge/contact-form.shtml</webform>
<youtube_url>http://www.youtube.com/marcialfudge</youtube_url>
<nickname/>
<gender>F</gender>
<district>11</district>
<title>Rep</title>
<congresspedia_url>http://www.opencongress.org/wiki/Marcia_Fudge</congresspedia_url>
<in_office>True</in_office>
<senate_class/>
<name_suffix/>
<twitter_id>marciafudge</twitter_id>
<birthdate>1952-10-29</birthdate>
<bioguide_id>F000455</bioguide_id>
<fec_id>H8OH11141</fec_id>
<state>OH</state>
<crp_id>N00030490</crp_id>
<official_rss/>
<facebook_id>RepMarciaLFudge</facebook_id>
<party>D</party>
<email/>
<votesmart_id>110640</votesmart_id>
</legislator>
−
<legislator>
<website>http://



-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.



More information about the grlug mailing list