post请求与get请求

 1  $.post('/manage.aa', function (response) {
 2         agentList = response.data;
 3     }, 'json');
 4     var categoryId;

5 $.get("/flow/flowDfne/queryFloRR.DD", {}, function (data) { 6 showCategory(data.data, 0); 7 if (categoryId != null && categoryId != undefined) { 8 $(".category").find("option[value=" + categoryId + "]").prop("selected", true); 9 } 10 form.render('select'); 11 }, "json");
//渲染下拉框

function showCategory(data, count) {
    $(data).each(function (i, n) {
var t = "";
for (var j = 0; j < count; j++) {
t += "&nbsp;&nbsp;&nbsp";
}
if (n.children.length > 0) {
$(".category").append("<option value='" + n.id + "' style='color:red !important;font-size:24px;'>" + t + n.title + "</option>");
showCategory(n.children, count + 1)
} else {
$(".category").append("<option value='" + n.id + "'>" + t + n.title + "</option>");
}
});

form.render('select');
}

猜你喜欢

转载自www.cnblogs.com/yangguoe/p/9120076.html