$(function() {//jq遍历json/数组var json =[{code:"101",val:"1111"},{code:"102",val:"2222"},{code:"103",val:"3333"}];$.each(json,function(index,j) {console.log(j.code+"---"+j.val);if(j.code=='102'){return false;//退出循环}});json=[101,102,103];$.each(json,function(index,j){console.log(j);if(j==102){return false;}});});
100字范文,内容丰富有趣,生活中的好帮手!