|
Re: [jQuery] Ajax to update multiple fields: msg#01206lang.javascript.jquery
Klaus Hartl wrote: > > Scott Sharkey schrieb: >> Klaus Hartl wrote: >>>> Quick question though -- I've been trying to make the code you posted >>>> work, and the call is getting through to the php script properly, and >>>> the php script is correctly (I think) returning the XML to my program. >>>> At least, firebug is showing what I expect as the response. >>>> >>>> However, the two functions that fetch the returned values are giving me >>>> nothing (var state = $("state",xml).text(); var city = >>>> $("city",xml).text();) >>>> >>>> I put a debugger stop right after those functions, and I get empty >>>> variables. The response string that I'm sending back is... >>>> >>>> <response><city>Columbus</city><state>Oh</state></response> >>>> >>>> I am assuming that the returned xml is defined in the $ object, but I >>>> don't know how to figure out what's wrong. Any suggestions? >>> Scott, make sure that the responded XML has the right MIME type. With >>> PHP it's done this way: >>> >>> >>> header('Content-type: text/xml'); >> Hi Klaus, >> >> Yeah, I have the correct content type -- do I need the XML encoding >> line? and/or the charset? Here's the beginning: >> >> header('Content-Type: text/xml; charset=utf-8'); >> header('Cache-Control: no-cache, must-revalidate'); >> echo '<?xml version="1.0" encoding="ISO-8859-1"?>'; >> >> -Scott > > The charset specified in the HTTP header and in the encoding declaration > should match, it is considered an error if the document's encoding is > not what was declared or assumed. Maybe that's already where your > problem arouses... Tried both UTF-8 and utf-8 in the encoding -- no difference. Tried ISO-8859-1 on both, no difference. I may try stepping through the jQuery code to see if I can figure out why. -Scott > > > -- Klaus > > _______________________________________________ > jQuery mailing list > discuss@xxxxxxxxxx > http://jquery.com/discuss/
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: [jQuery] Possible changes to hide/show, Brandon Aaron |
|---|---|
| Next by Date: | [jQuery] Greybox Redux (Reworked) (Demo), Benjamin Yu |
| Previous by Thread: | Re: [jQuery] Ajax to update multiple fields, Klaus Hartl |
| Next by Thread: | Re: [jQuery] Ajax to update multiple fields, Scott Sharkey |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |