$(data.resultList).each(function () {
var selectedFlag = ${sessionScope.userInfo.roleLeve}==this.role_leve ? "selected =‘selected‘" :"";
roles.append("<option value=‘" + this.role_leve + "‘ "+selectedFlag+" >" + this.role_CName + "</option>");
})
即可破之!
其实有的时候不要钻牛角尖,换一种思路可能会换来意想不到的结果!
时间: 2024-10-05 16:36:13