标签:cte div _id query ssi append foreach log rmi
html 页面
<tr> <td class="dc-form-left">权限组:</td> <td class="dc-form-right"> <select name="group_id" class="form-control" id="group_id" style="width: 300px;"> @if($permission_list) @foreach($permission_list as $val) <option value="{{$val[‘id‘]}}" @if($group_id == $val[‘id‘] ) selected @endif>{{$val[‘name‘]}}</option> @endforeach @endif </select> </td> </tr>
jquery 代码
$(document).on(‘change‘, ‘select[name=type]‘, function(){ $.get(‘/permission_list‘, { type: $(‘select[name=type]‘).val() }, function(res){ var group = $("#group_id"); group.empty(); for(var i=0;i<res.length;i++) { group.append("<option value=‘"+res[i].id+"‘>"+res[i].name+"</option>"); } }); });
标签:cte div _id query ssi append foreach log rmi
原文地址:http://www.cnblogs.com/zouzhe0/p/7102315.html