function changeCate(){ var mainCategoryId = $("#mainCategoryId").find("option:selected").val(); if(mainCategoryId == "") { $(".categoryId").empty().append(""); return false; } $.ajax({ url:'/tvtao/video/item/category.htm', type:"post", dataType:"json", data: {'_tb_token_' : $("input[name='_tb_token_']").val(), parantId : mainCategoryId}, success: function (data) { console.log(data); $(".categoryId").empty().append(""); for(var i = 0, len = data.length; i < len; i++) { alert(data[i].id); $(".categoryId").append($("")); } } }); }
The above is the detailed content of How to achieve select select secondary linkage effect. For more information, please follow other related articles on the PHP Chinese website!