<html>
<head>
<script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.8.0.js"></script>
<script type="text/javascript">
$().ready(function(){ 
getSelectVal(); 
$("#bigname").change(function(){ 
getSelectVal(); 
}); 
});
function getSelectVal(){ 
$.ajaxSetup({
error:function(x,t,e){
$("#hey").html(x+t+e.message);
}
});
alert($("#bigname").val());
$.getJSON("server.php",{"bigname":$("#bigname").val()},function(json){ 
alert("can you see it??");
var smallname = $("#smallname"); 
$("option",smallname).remove(); //清空原有的选项 
$.each(json,function(index,array){ 
var option = "<option value='"+array['id']+"'>"+array['title']+"</option>"; 
smallname.append(option); 
}); 
}); 
} 
</script>
</head>
<body id="hey">
<label>大类:</label> 
<select name="bigname" id="bigname"> 
<option value="1" >前端技术</option> 
<option value="2" selected="selected">程序开发</option> 
<option value="3">数据库</option> 
</select> 
<label>小类:</label> 
<select name="smallname" id="smallname"> 
</select> 
</body>
</html>
二级联动第二个列表无法显示。
运行到getJSON出错。
$.ajaxSetup({
error:function(x,t,e){
$("#hey").html(x+t+e.message);
}
});
返回
[object Object]parsererrorUnexpected token <