I want to limit the amount of results that are being returned from this AJAX call to 5. I think I could use .slice() to do this but I'm not exactly sure what way to go about it.
$(document).ready(function() {
$.ajax({
type: "GET",
url: "myurl",
dataType: "xml",
cache: false,
success: parsePopular
});
});
function parsePopular(popular) {
$(popular).find("item").each(function() {
$("#popularArticles").append("<h1><p class='Bold'><a href='" + $(this).find("link").text() + "'>" + $(this).find("title").text() + "</a></p></h1>");
});
}
Any ideas would be great.
Thanks.