$.each 用break 好像不太灵啊

      for(var i=0;i<obj.length;i++) {
                   
                    if (i < 5) {
                        strhtml += "<li>" + obj[i].OrderNo + " <a href='/product/OrderIndex'>查看</a> </li>";
                    }else
                    {
                        strhtml += "<li><a href='/product/OrderIndex'>......</a></li>";
                        break;
                    }
                };
                //$.each(obj, function (i, item) {
                //    strhtml += "<li>" + item.OrderNo + " <a href='/product/OrderIndex'>查看</a> </li>";
                //    if(i>3)
                //    {
                //        strhtml += "<li><a href='/product/OrderIndex'>......</a> </li>";
                //        return false;
                //    }  
                //});

posted @ 2016-12-22 17:01  阿Q啊  阅读(511)  评论(0编辑  收藏  举报