一、前言
在前端开发过程中,代码校验和格式化能够有效地提高Coding效率,在此把自己用到过的网址记录下来。
二、网站地址
HTML、XML、CSS、JSON、JavaScript、Java、SQL格式化
http://tool.oschina.net/codeformat/xml
JSON校验、压缩、发送,正则校验
http://www.ij2ee.com/bejson/bejson.html
三、JSON代码规范
记录下自己写过的最复杂的JSON文件,应该是涉及到所有的规范了,方便以后查看。
注:JSON对象不应该包含中文注释,以下例子中的中文注释只是部分数据的省略说明。
{"statusCode":"-1", "valid":"1","dataType":"JsonObject", "params":{ "type":"route","oper":"name","start":"北京邮电大学教四217","end":"清华大学主楼405"}, "content":{ "startName":"北京邮电大学教四217","endName":"清华大学主楼405","routePlanCount":"8","routePlan":[ //方案一{"planIndex":"0","totalTime":"105","routeDescription":["起点:北京邮电大学教四217","步行至教四东门,约20米","步行至明光桥北,约300米","乘坐80路(清华园方向),在清华大学站下车(12站)","步行至清华大学主楼南门,约150米","步行至清华大学主楼405,约100米","终点:清华大学主楼405"],"sectionCount":"6","section":[ {"type":"indoor","time":"5","start":"北京邮电大学教四217","end":"北京邮电大学教四南门","mapID":"buptj4","mapName":"北京邮电大学教四","floors":"4","floorsIndex":"2","description":["(2F)从217门口出发,向前走1米","(2F)向右转,走11米","(2F)向右转,走55米","(2F)向左转,走3米,下楼至南门"],"coords":"9.0,-30.5,8.35,-30.5,8.35,-19,61.5,-19,61.5,-16.6"},{"type":"outdoor","time":"10","start":"北京邮电大学教四南门","end":"明光桥北站","mapID":"bupt","mapName":"北京邮电大学","description":["教四南门出发,向前走10米","向右转,走50米","向左转,走55米,到北邮西门","向左转,走100米,至明光桥北站"],"coords":"9.0,-30.5,8.35,-30.5,8.35,-19,61.5,-19,61.5,-16.6"},{"type":"wait","time":"10"},{"type":"bus","time":"60","start":"明光桥北站","end":"清华大学站","busTransfer":{//公交版数据}},{"type":"outdoor","time":"10","start":"清华大学站","end":"步行至清华大学主楼南门","mapID":"thu","mapName":"清华大学","description":["清华大学站出发,向前走10米","向右转,走50米","向左转,走55米,到清华大学西门","向左转,走100米,至主楼南门"],"coords":"9.0,-30.5,8.35,-30.5,8.35,-19,61.5,-19,61.5,-16.6"},{"type":"indoor","time":"5","start":"清华大学主楼南门","end":"清华大学主楼405","mapID":"thuzl","mapName":"清华大学主楼","floors":"15","floorsIndex":"4","description":["(4F)上至4楼,向前走10米","(4F)向右转,走11米","(4F)向右转,走55米","(4F)向左转,走3米,至405"],"coords":"9.0,-30.5,8.35,-30.5,8.35,-19,61.5,-19,61.5,-16.6"}]},//方案二{ },//方案三{ },//方案四{ },//方案五{ },//方案六{ },//方案七{ },//方案八{ }]}
}
四、后记
人类的惰性有时能促进生产工具的提升,甚至是技术的革新,而知识的记录和分享,则是营造在知识普及的情况下,引起更广泛的学习和更进一步讨论,产生更多的知识。