Get data from XML file and pass it on as a search parameter

junekomodo

New Member
I am trying to retrieve the Bird ID number from an XML file(birds.xml) and pass it on to another website as one of their search parameters but my codes below doesn't seem to work\[code\]<script>$(function() { function log( message ) { $( "<div/>" ).text( message ).prependTo( "#log" ); $( "#log" ).attr( "scrollTop", 0 ); } $.ajax({ url: "birds.xml", dataType: "xml", success: function( xmlResponse ) { var data = http://stackoverflow.com/questions/14052272/$("geoname", xmlResponse ).map(function() { return { value: $( "name", this ).text() + ", " + ( $.trim( $( "countryName", this ).text() ) || "(unknown country)" ), id: $( "geonameId", this ).text() }; }).get(); $( "#birds" ).autocomplete({ source: data, minLength: 0, select: function( event, ui ) { log( ui.item ? ui.item.id : "Nothing selected, input was " + this.value ); } }); } });});</script></head><body><form action="bird.htm" method="get" target="_blank"> <label for="birds">bird matches: </label> <input id="birds" /> <input type="hidden" id="log" name="birdname" value="'birdID'"/><input type="submit" value="http://stackoverflow.com/questions/14052272/Submit"></form>\[/code\]I don't know where i have gone wrong, can someone please help. Thank you very much for your kind help
 
Back
Top