I have a collections of News objects:
List<News> news = new ArrayList<News>();
On my jsp file, I use Struts' iterator to display the first 6 elements of my List.
<s:iterator id="iter" value="news" begin="0" end="5">
<p><s:property value="title" /></p>
</s:iterator>
Assume I have a 'Load more' button on my page which adds 6 more elements when pressed. I want this button to change the 'end' attribute of my iterator to 11. Is it possible doing this with jQuery?
Maybe something like this:
$(document).ready(function() {
$("a#button").on('click', function(e) {
var end = $(.iter).attr('end');
end += 6;
return true;
});
});
If not, what's the best alternative?
Thank you