$(function(){ //获得JSON数据
$.getJSON("registerLoad/tags.html",function(json){
//清空内容
$("#note_tage_1").find("li").remove();
var count =1;
//var tags = "";
//便利JSON数组对象
$.each(json,function(i,item){
if(count <= 4){
tag = "{"+item.tagid+":\""+item.tag+"\"}";
var info = "<li class='b"+count+"'><a href='javascript:void(0)' onclick='addtag({"+item.tagid+":\""+item.tag+"\"});'>"+item.tag+"</a></li>";
//添加内容
$("#note_tage_1").append(info);
count ++;
}else{
count =1;
}
});
// $("#note_tage_1").html(tags); });
转载于:https://blog.51cto.com/18073491002lgx/1860756