Jquery Templeate, droping last item off in the each

Posted by Lawrence on Stack Overflow See other posts from Stack Overflow or by Lawrence
Published on 2011-06-21T20:08:51Z Indexed on 2011/06/22 0:22 UTC
Read the original article Hit count: 160

Filed under:

Currently I am using jquery templating with some json data, I have a couple images that I am getting and I would like to drop the last image that I am getting from my json data. Right now I have this coded ( this only a snippet of the spot I am having the problem at):

                <div class="altViews">
                <ul class="clearfix">
                {{each(i,addImage) AdditionalImages}}
                    <li class="altImage">
                        <img src="http://images.url.com/images/products/${addImage}" alt="${Name}" id="${addImage}"/>
                    </li>
                    {{/each}}
                </ul>
            </div>

SO the main help I need is to be able to drop the last li, I just dont know how to use my index to do that.

© Stack Overflow or respective owner

Related posts about jQuery