首页 > 代码库 > $.each 用break 好像不太灵啊

$.each 用break 好像不太灵啊

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

$.each 用break 好像不太灵啊