jquery parse XML that is in a td returned from server

Making an ajax call to return some data from the server. The data comes back as such:\[code\]<table border=1> <tr> <td>Field Name</td> <td>Field Value</td> </tr> <tr> <td>SuccessFlag</td> <td>True</td> </tr> <tr> <td>ResponseMessage</td> <td><?xml version="1.0" encoding="utf-16"?> <License> <CustomerID>Bob</CustomerID> <License>XXXX-XXXX-XXXX-XXXX-XXXX-XXXX-XXXX-XXXX</License> <Log>Created by [email protected] on December 6, 2012, 1:09 pm Cancelled by [email protected] on December 6, 2012, 1:09 pm</Log> <ExpirationDate>2012-12-06</ExpirationDate> </License> </td> </tr></table>\[/code\]I am able to output the data like this:\[code\]//ajax call stuffsuccess: function(data) { var answer = $(data).find("td:eq(3)").text(); var message = $(data).find("td:eq(5)").text();if (answer==="True") { $('input[type="text"], input[type="password"]').val(""); $('#resultGenerate').show().html('<ul><li>' + message + '</li></ul>'); } else { $('.processing').hide(); $('input[type="text"], input[type="password"]').val(""); $('#resultGenerate').show().html('<ul><li>' + answer + '</li><li>' + message + '</ul>'); }}\[/code\]basically I just go to the 5th td of the table and output the message. I need to format back into a table or more well constructed output. I am assuming I would create a function to parse out each tag and value pair and then run the function? Need some assistance, thank you as always!
 
Back
Top