描述:
访问页面时加载好第一个下拉列表(下文中A下拉框),选中击其中的某个选项后动态加载好第二个下拉框(下文中的B下拉框)。
jsp中的代码:
js部分:
function toSet(flag){
var id=flag;
$.ajax({
type:"get",
dateType:"json",
url:"${pageContext.request.contextPath }/D003/major.do",
data:"shipperCode="+id,
async:false,
success:function(data){
$("#delivery").empty();
$("#delivery").append("<option value=''>--请选择--</option>");
//解析后台返回的json字符串
var s=<