I am not sure how to for this question correctly to get where I want to go. I have a JavaScript that runs well. It returns a huge set of data that I need to group to display in a more readable way.
sample code
function parsePData(data) {
var xmlDoc = $j.parseXML(data.d);
var $xml = $j(xmlDoc);
var items = $xml.find("Page");
userFavorites = $xml;
var newHtml = ""
for (var i = 0; i < items.size(); i++) {
newHtml += "<div style='margin:5px; padding:5px; border-bottom: 1px dotted #9C9C9C; font- size:95%'><div> <b>#" + (i + 1) + ".</b>Item to Publish: " + items[i].getAttribute("Title") +
"</div><div class='itpPub'> Publication Target: " + items[i].parentNode.getAttribute("Title") +
"</div></div>";
}
I need some pointers or directions to relevant posts on how to go about grouping this output. Apologies if i have missed the obvious posting.
The code creates the following output:
Item to Publish: a , Publication Target: 1
Item to Publish: a , Publication Target: 2
Item to Publish: b , Publication Target: 7
and I need to get to:
Item to Publish: a , Publication Target: 1, 2
Item to Publish: b , Publication Target: 7