Jquery .text() seems not to work on XML in IE7

Posted by volder on Stack Overflow See other posts from Stack Overflow or by volder
Published on 2010-05-20T19:36:04Z Indexed on 2010/05/20 19:40 UTC
Read the original article Hit count: 123

Filed under:
|
|

My PHP backend sends XML response to the client (ajax):

<response>
   <code>0</code>
   <message>OK</message>
</response>

in the javascript I'm trying to get CODE value in this way: var errorCode = $('code', xml).text();

and then depending on errorCode value I do processing.

It is working fine in all browsers I tested except IE7. Instead of CODE value - it is giving me the empty string. The problem is not in 0 value, because I tried to use 5 as a code for example - the result was the same.

Any ideas, because I'm stuck with :((

Thanks.

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about Xml