- What type of element is #Querycontent?
-
Are you trying to replace all of the content of the #Querycontent with new stuff? or append more values to it?
Try this:
Replace the entire content (I'm assuming #Querycontent is a <ul> or <ol>):
var $Querycontent = $("#Querycontent");
var liHtml = "";
// Build all new values
$(xData.responseXML).SPFilterNode("z:row").each(function() {
var DocNo = ($(this).attr("ows_DocumentNo"));
var href = ($(this).attr("ows_View_x0020_Item")).split(",")[0];
liHtml += "<li><a href='"+ href +"' target='_blank'>" + DocNo + "</a></li>";
});
// CLear all existing values and Append new values to the List
$Querycontent.empty().append(liHtml);
/Paul.