1.语法 jQuery.post(url,data,success(data, textStatus, jqXHR),dataType)
$("#vkmid").change(function(){
var url = $url = $(this).data('url');
var mid = $(this).val();
$.post(url,{mid:mid},function(rs){
var data = rs.category;
var data1 = rs.controllist;
if(data)
{
jQuery("#catid").empty();
// alert(data.length);
if(data.length > 0)
{
// jQuery("<option value=0>请选择</option>").appendTo(jQuery("#catid"));
jQuery("<option value=0>选择栏目</option>").appendTo(jQuery("#catid"));
jQuery.each(data,function(idx,item)
{
jQuery("<option value="+item.cid+">"+item.cid+" | "+item.cname+" | "+item.ccaption+"</option>").appendTo(jQuery("#catid"));
});
}
else
{
jQuery("<option value=0>无栏目</option>").appendTo(jQuery("#catid"));
}
}
else
{
jQuery("#catid").empty();
jQuery("<option value='0'>请选择</option>").appendTo(jQuery("#catid"));
}
if(data1)
{
jQuery("#conid").empty();
// alert(data1.length);
if(data1.length > 0)
{
// jQuery("<option value=0>请选择</option>").appendTo(jQuery("#conid"));
jQuery("<option value=0>选择功能</option>").appendTo(jQuery("#conid"));
jQuery.each(data1,function(idx,item)
{
jQuery("<option value="+item.cid+">"+item.cid+" | "+item.cname+" | "+item.ccaption+"</option>").appendTo(jQuery("#conid"));
});
}
else
{
jQuery("<option value=0>无功能</option>").appendTo(jQuery("#conid"));
}
}
else
{
jQuery("<option value='0'>请选择</option>").appendTo(jQuery("#conid"));
}
})
})
})