How do you find out what element type the root element is with jquery

Posted by user363873 on Stack Overflow See other posts from Stack Overflow or by user363873
Published on 2010-06-10T19:37:18Z Indexed on 2010/06/10 19:42 UTC
Read the original article Hit count: 145

Filed under:
|
|

I'm sending an ajax request that will either give me an error or a userID

<?xml version="1.0" encoding="UTF-8"?>
<error>1000</error>

<?xml version="1.0" encoding="UTF-8"?>
<userID>8</userID>

how can I find out if the root element is error or userID using jquery or just javascript in general. Using the find method doesn't appear to work if what you're trying to access is the root element

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about jQuery