ajax-返回json
来源:互联网 发布:澳大利亚gpa算法 编辑:程序博客网 时间:2024/04/28 14:39
function qSubType(selobj){
if(selobj!=null){
var caseSubType=document.getElementById("caseSubType");
caseSubType.options.length=0;//清空select下拉框
if(selobj.value.length!=0){
jQuery.ajax({
type:"POST",
url:"${ctx}/partner/product.do?method=qProductSubType",//处理请求的action方法
//data:"selectId="+jQuery("#"+selectId).val(),//传递的参数
data:{'name':selobj.options[selobj.selectedIndex].text,'id':selobj.options[selobj.selectedIndex].value},//传递的参数
dataType:"html",
success:function(data) {
if(data!=null&&data!=''){
data=eval('('+data+')');
if(data.subtype!=null&&data.subtype!=''){
var subtypearray=data.subtype;
if(subtypearray!=null&&subtypearray.length!=0){
for(var i=0;i<subtypearray.length;i++){
var temp=subtypearray[i];
var value=temp.remark;
var text=temp.name;
caseSubType.options.add(new Option(text,value));
}
}
}
}
},
error : function() {
//alert("审核失败!");
}
});
}
}
}
--返回json
{subtype:[{"deleted":0,"flag":0,"id":1027,"mark":"云主机产品","name":"云主机虚拟机","parent_id":1026,"remark":"1"},{"deleted":0,"flag":0,"id":1028,"mark":"云主机产品","name":"云主机物理机","parent_id":1026,"remark":"2"},{"deleted":0,"flag":0,"id":1029,"mark":"云主机产品","name":"定制云虚拟机","parent_id":1026,"remark":"3"},{"deleted":0,"flag":0,"id":1030,"mark":"云主机产品","name":"定制云物理机","parent_id":1026,"remark":"4"}]}
--java
String json="{subtype:\"\"}";
JSONArray jo = JSONArray.fromObject(productSubTypeList);
json="{subtype:"+jo.toString()+"}";
- ajax 返回json
- AJax 返回 json
- ajax-返回json
- ajax返回json数据
- ajax json 请求返回
- Ajax返回JSON数据
- Ajax 返回 json
- ajax返回json数据
- ajax json数据返回
- ajax返回json串
- Json实例:ajax返回多个值
- Json实例:ajax返回多个值
- springMVC+ajax返回JSON串
- $.ajax接收json,返回error
- SpringMVC+ajax返回JSON串
- django中ajax返回json
- C# Ajax 返回json数据
- ajax SpringMVC如何返回json
- Android Calendar的运用
- 虚函数、纯虚函数详解
- NFC学习——准备
- 为了安全起见,要求使用强SA密码。请使用SAPWD开关提供同一密码
- 系统变量和用户变量及其运用
- ajax-返回json
- 999
- 【IOS】Instruments 使用教程 .
- 三 VI文本编辑器的使用间单
- hibernate配置数据库连接池的三种方法
- python的学习(十七)----import机制
- linux mem layout
- Android 如何使用GPU硬件加速
- 终端快捷键