function compare(name, minor) { return function (o, p) { var a, b; if (o && p && typeof o === 'object' && typeof p === 'object') { a = o[name]; b = p[name]; if (a === b) { return typeof minor === 'function' ? minor(o, p) : 0; } if
<script type="text/javascript"> getJson('age'); function getJson(key){ var jsonObj={"name":"傅红雪","age":"24","profession":"刺客"}; //1.使用eval方法 var eValue=eval('jsonObj.'+key); alert