XML find and each not finding or "eaching".
Here is my xml output from the php file...
- <?xml version="1.0" encoding="utf-8" ?><msgs crid="0"><msg><time>1282858661408571</time><uid>Sub7</uid><text>ds</text></msg><msg><time>1282858673545392</time><uid>Sub7</uid><text>d</text></msg></msgs><users crid="0"></users>
Here is my javascript function. Everything is working normally up to here (checked in firedebugger).
- function parseXml(xml)
- {
- $(xml).find('msgs').each(function(){
- alert(1);
- var crid = $(this).attr('crid');
- $(this).find('msg').each(function(){
- var time = $(this).find('time').text();
- var userid = $(this).find('uid').text();
- var text = $(this).find('text').text();
- AddChat(userid,text);
- });
- });
- $(xml).find('users').each(function(){
- var crid = $(this).attr('crid');
- $(xml).find('user').each(function(){
- var lastupdate = $(this).find('lastupdate').text();
- var status = $(this).find('status').text();
- var username = $(this).find('username').text();
- });
- });
- }
My issue here is that alert(1); never fires... even though msgs exists in the xml and is passed to the jquery find and each function it detects nothing... Can anyone explain this? I have the latest jquery min version.