$.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;
                //    }  
                //});

时间: 2024-10-24 14:42:54