/** * Get all keys in JSON data*/functionFetchresponseinfo (responseinfo) {//determines whether the empty if((!responseinfo | | responseinfo.length <= 0)) { return; } //Get Model varJsoncon =Jquery.parsejson (responseinfo). Model; if(!Jsoncon) { return; } //Get all keys varKeyarr; if(JsonconinstanceofArray) { //1-jsonarray if(jsoncon.length <= 0){ return; } varArrob = jsoncon[0]; Keyarr=Object.keys (Arrob); }Else if(JsonconinstanceofObject) { //2-jsonobjectKeyarr =Object.keys (Jsoncon); }Else{ //3-other return; } if(!keyarr | | keyarr.length <= 0){ return; } //Assemble an array varTemob; varLang = "Java.lang.String"; varDescription = ""; varResarr =NewArray (); for(i = 0; i < keyarr.length; i + +)) {Temob=NewObject (); Temob.param=Keyarr[i]; Temob.lang=Lang; Temob.description=description; Resarr[i]=Temob; } returnResarr; }
Get all key collections in JSON data