[GRLUG] trouble extracting from XML (Ajax)
Dave Brondsema
dave at brondsema.net
Fri Feb 4 08:27:56 EST 2011
While I'm sure some people on this list do have some ideas, I'd suggest
emailing the grwebdev list. http://groups.google.com/group/grwebdev/
On 02/04/2011 07:34 AM, Eric Beversluis wrote:
> 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://
>
>
>
--
Dave Brondsema : dave at brondsema.net
http://www.brondsema.net : personal
http://www.splike.com : programming
<><
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 835 bytes
Desc: OpenPGP digital signature
URL: <http://shinobu.grlug.org/pipermail/grlug/attachments/20110204/bbfde48c/attachment.pgp>
More information about the grlug
mailing list