[jQuery] Reading HTML from XML
I use CodeIgniter and jQuery for my frameworks, and i was using the
AJAX functions and I tried using XML for a return type, and when id
have an error message, it would return a <div> like this format:
<response><status>><div class="error">errormsg)</div></status></
response>
And I had to set to read it like this:
and the callback for the success is:
function processlogin(data)
{
status = $('status', data).text();
if(status == 'success')
{
//Code I ran if the data matched, which isnt causing the problem
}
else
{
$('#loginform').after(status);
}
}
I know its the <div> thats causing it to not be read, but is there any
way I can make it read the div and its content? So far I just said to
hell with it and went with JSON, seeing XML isnt very good for data
exchange, but more for documents..