How do I check whether the result data set from an AJAX call has only 1
parent node?
Please refer to the if statement in the code:
function CreateProjectTree(sc)
{
$.ajax({
type: "POST",
url: "../api/projects/SearchProjects",
data: sc,
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function(data)
{
if (data contains only 1 parent node)
{
//redirect page to X page
}
else
{
buildTree(data);
}
},
});
}
The result of the call is an XML and I need to check whether it only has 1
parent node (regardless of the number of children).
How would I go about doing this?
No comments:
Post a Comment