The perl script sends an application/xml header. And where am I bypassing UTF encoding?
(The responseXML in the code shouldn't have been there by the way, it was just a leftover from my attempts to work around the problem) On Jun 25, 6:16 pm, "Ⓙⓐⓚⓔ" <[EMAIL PROTECTED]> wrote: > q:when is an xml not an xml? > > a:when it's got the wrong header! > > if a browser doesn't think the xml is xml, you get an empty responseXML > > look at the pl program and make sure it's setting a header for ie to know > it's really setting the right header. > > as an aside, I hope you never get an address on Jürgenstraße, you are > bypassing utf encoding! > > On 6/25/07, Gordon <[EMAIL PROTECTED]> wrote: > > > > > > > I am writing an application that looks up addresses based on post > > codes. I have modified the perl script that the database provider > > supplied to output XML, and now I need to write some client side > > javascript to parse the results. > > > At the moment I'm at a very early stage and thought it would be a good > > idea to process the XML with jquery but I have run into something of a > > snag. > > > var addressLookupScript = '/cgi-bin/getAddress.pl' > > > function listAddresses (xml) > > { > > console.log (xml); > > $('address', xml.responseXML).each (function (index) > > { > > console.log (index); > > }); > > } > > > $(document).ready (function () > > { > > var addressField = $('#address'); > > $('#lookup').click (function () > > { > > $.ajax ({ > > type : 'GET', > > dataType : 'xml', > > url : addressLookupScript + > > '?address=' + addressField.val (), > > success : function (response) > > {listAddresses (response);} > > }); > > }); > > }); > > > As you can see the script doesn't do very much yet, it just loops over > > the returned XML and outputs an index number of each loop. > > > I found that this approach works perfectly in FireFox, but when I > > tried to run the same code in Internet Explorer, nothing happened. > > Firebug Lite just logged an empty line at the console.log (xml) line > > and didn't execute the loop. > > > I think that logically my code is correct, but there is something > > about it that IE doesn't like. If you can shed some light on this I'd > > appreciate a fix or a workaround of some sort. > > -- > Ⓙⓐⓚⓔ - יעקב ʝǡǩȩ ᎫᎪᏦᎬ