jQuery append doesn't always work

mashbleadsyka

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