I am using jQuery to parse XML. I got to the point where i get the values from it. The code is as follows:
$(xml).find('item').each(function(){
var message = "<span>" + $(this).find('value').text() + "</span>";
$(message).appendTo('#main');
});
now, the problem is the following:
the code above works, but this code doesn’t work:
$(xml).find('item').each(function(){
var message = $(this).find('value').text();
$(message).appendTo('#main');
});
use the inverse of appendTo