WorknHardr
asked on
AJAX responseText Each Value Append UL?
Q. How do I return this ajax responseText into a ul li ?
Here's what I have so far, pretty close...
{"readyState":4,"responseT ext":"[\"v alue1\",\" value2\"]" ,"response JSON":["va lue1","val ue2"],"sta tus":200," statusText ":"OK"}
Here's what I have so far, pretty close...
{"readyState":4,"responseT
<ul id="list"></ul>
$.ajax ...
,complete: function (response)
{
var array = jQuery.parseJSON(response.responseText);
alert(array); // Value1,Value2
$.each(array.split(','), function(item)
{
$('#list').append('<li>' + item + '</li>');
});
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You are welcome - thanks for the points.
ASKER