我正在寻找具有父子关系的多选下拉列表。我在互联网上找到了此链接http://davidstutz.de/bootstrap-multiselect/#configuration-options-enableCollapsibleOptGroups。
我正在尝试以下示例,但出现以下错误:
CORS策略已阻止从原点'null'访问'http://davidstutz.de/bootstrap-multiselect/docs/fonts/glyphicons-halflings-regular.woff2'的字体:所请求的资源上没有'Access-Control-Allow-Origin'标头。
glyphicons-halflings-regular.woff2:1无法加载资源:net :: ERR_FAILEDCORS策略已阻止从原点'null'访问'http://davidstutz.de/bootstrap-multiselect/docs/fonts/glyphicons-halflings-regular.woff'的字体:所请求的资源上没有'Access-Control-Allow-Origin'标头。
glyphicons-halflings-regular.woff:1无法加载资源:net :: ERR_FAILEDCORS策略已阻止从原点'null'访问'http://davidstutz.de/bootstrap-multiselect/docs/fonts/glyphicons-halflings-regular.ttf'的字体:所请求的资源上没有'Access-Control-Allow-Origin'标头。
glyphicons-halflings-regular.ttf:1无法加载资源:net :: ERR_FAILED
如何避免此CORS政策错误?如何验证已选中或未选中?
$(document).ready(function() {
$('#example-enableCollapsibleOptGroups-enableClickableOptGroups-enableFiltering-includeSelectAllOption').multiselect({
enableClickableOptGroups: true,
enableCollapsibleOptGroups: true,
enableFiltering: true,
includeSelectAllOption: true
});
});
<link rel="stylesheet" href="http://davidstutz.de/bootstrap-multiselect/docs/css/bootstrap-3.3.2.min.css">
<link rel="stylesheet" href="http://davidstutz.de/bootstrap-multiselect/docs/css/bootstrap-example.min.css">
<link rel="stylesheet" href="http://davidstutz.de/bootstrap-multiselect/docs/css/prettify.min.css">
<link rel="stylesheet" href="http://davidstutz.de/bootstrap-multiselect/dist/css/bootstrap-multiselect.css">
<select id="example-enableCollapsibleOptGroups-enableClickableOptGroups-enableFiltering-includeSelectAllOption" multiple="multiple">
<optgroup label="Group 1">
<option value="1-1">Option 1.1</option>
<option value="1-2">Option 1.2</option>
<option value="1-3">Option 1.3</option>
</optgroup>
<optgroup label="Group 2">
<option value="2-1">Option 2.1</option>
<option value="2-2">Option 2.2</option>
<option value="2-3">Option 2.3</option>
</optgroup>
</select>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.js"></script>
<script type="text/javascript" src="http://davidstutz.de/bootstrap-multiselect/docs/js/bootstrap-3.3.2.min.js"></script>
<script type="text/javascript" src="http://davidstutz.de/bootstrap-multiselect/docs/js/prettify.min.js"></script>
<script type="text/javascript" src="http://davidstutz.de/bootstrap-multiselect/dist/js/bootstrap-multiselect.js"></script>