you can use the .lt() command before the .each to narrow the results, so if you want the first 10, you would use something like $(this).lt(10).each.......
//Kristinn On 2/21/07, john smith <[EMAIL PROTECTED]> wrote: > Sorry all Im still a newb to jquery. Ive been messing around with using > jquery for grabbing and displaying rss feed info. A lot less code then using > straight javascript. what Im not quite clear on is how you grab a specific > count from doing an .each > > For example if I grab a feed with the jquery code below > > // count for lines display > var items_count = 10; > > // feed location > var feed = my.xml'; > > // replace url for link > var u = 'http://www.mypage.html?txtSearch=' > > $(document).ready(function(){ > $.get(feed, function(xml){ > $("item", xml).each(function(){ > $(this).find("item").each(function(){ > html += ""; > }).end().find("title").each(function(){ > html += "<a href='" + u + this.text + "'>" + > this.text + "</a><br>"; > }); > }); > $("#feed").html(html).slideDown("slow"); > > }); > }); > > Using jquery how do I do a for each count like: > for(var i=0; i<items_count; i++) { > > ________________________________ > Access over 1 million songs - Yahoo! Music Unlimited. > > > _______________________________________________ > jQuery mailing list > [email protected] > http://jquery.com/discuss/ > > _______________________________________________ jQuery mailing list [email protected] http://jquery.com/discuss/
