i am calling an api for registration and if everything goes well then api returns an xml file
"<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\u000a<successNotification>\u000a\u0009<message>Successful web registration<\/message>\u000a\u0009<registrationId>22342347<\/registrationId>\u000a<\/successNotification>"
if something wrong then it returns a line of message
you are missing something
my question is: how can i display message regardless whether it returns xml or just line of message:
$.getJSON('http://localhost:4126/service.svc/alert', { phoneNumber: '01231231233' },
function (data) {
var result = $(data).find('message').html;
display.innerHTML = result;
});