首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > JavaScript >

ext中json页面处置接收的值

2013-09-07 
ext中json页面处理接收的值JSONArray jsonRoot new JSONArray()JSONObject item new JSONObject()it

ext中json页面处理接收的值

JSONArray jsonRoot = new JSONArray();JSONObject item = new JSONObject();item.put(UIConstants.JSON_ID, deptId);item.put(UIConstants.JSON_NAME, deptName);item.put(UIConstants.JSON_NODETYPE, "dept");jsonRoot.put(item);String jsonOrgs = jsonRoot.toString();request.setAttribute("jsonOrgs", jsonOrgs);

 success: function(json){   var aa = json.responseText;  var data = eval('('+aa+')');  var bb=data.rows;  var sele = document.getElementById("s2");  sele.innerHTML = "";  var option2 = document.createElement('option');  option2.value ="";  option2.text= "请选择";  option2.selected="selected";  sele.add(option2);  for(var i=0;i<bb.length;i++){  var option = document.createElement('option');  option.value = bb[i].id;  option.text= bb[i].name;  sele.add(option);    } }

热点排行