1、将json格式的数据转换为json

var lineHead="[";
lineHead+="{'mainType':'party','loginName':'G010000000312502','name':'1'},";
lineHead+="{'mainType':'admin','loginName':'G010070004902510','name':'2'},";
lineHead+="{'mainType':'union','loginName':'G001000001522503','name':'3'},";
lineHead+="{'mainType':'youthLeague','loginName':'G010030007682504','name':'4'},";
lineHead+="{'mainType':'discipline','loginName':'G001000000362505','name':'5'}]";
var json=eval('('+lineHead+')');

2、定义json数据,以及对其进行遍历

var config = {"home":{"":"请选择","home":"主页"},
                  "kcjj":{"":"请选择","kcjj":"课程简介"},
                  "kcts":{"":"请选择","kcts":"课程特色","cxd":"创新点"},
                  "jxdw":{"":"请选择","kcfzr":"课程负责人","zjjs":"主讲教师","jxgg":"教学改革","jycg":"教研成果","jsszdwjgjztsz":"师资队伍结构及整体素质"},
                  "ktjx":{"":"请选择","jxdg":"教学大纲","xyjc":"选用教材","jxjdb":"教学进度表","ktjxms":"课堂教学模式","jxffysd":"教学方法与手段"},
                  "sjjx":{"":"请选择","sjjxzds":"实践教学指导书","sjjxdg":"实践教学大纲","sjjxtj":"实践教学条件",
                    	  "sjjxms":"实践教学模式","kcsjzds":"课程设计指导书","kcsjdg":"课程设计大纲","sjjxffysd":"时间教学方法与手段"},
                  "kcjs":{"":"请选择","kcjsygh":"课程建设与规划"},
                  "jxxg":{"":"请选择","lxpj":"录像评价","xspj":"学生评教","xszp":"学生作品","xnddzpj":"校内督导组评价","xwzjpj":"校外专家评价"},
	              "zczc":{"":"请选择","xgwj":"相关文件","jpkczp":"精品课程自评"}
	                  }; 
	for(var key in config){
		if(key==value){
			return config[key];
		}
	}




GitHub 加速计划 / js / json
41.72 K
6.61 K
下载
适用于现代 C++ 的 JSON。
最近提交(Master分支:1 个月前 )
960b763e 4 个月前
8c391e04 6 个月前
Logo

旨在为数千万中国开发者提供一个无缝且高效的云端环境,以支持学习、使用和贡献开源项目。

更多推荐