bootstrap multiselect:TypeError:$(...).multiselect不是一个函数 [英] bootstrap multiselect : TypeError: $(...).multiselect is not a function
本文介绍了bootstrap multiselect:TypeError:$(...).multiselect不是一个函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想使用bootstrap多选插件: Bootstrap多选
I want to use the bootstrap multi select plugin : Bootstrap Multiselect
但这对我不起作用.
<script type="text/javascript" src="dist2/js/bootstrap-multiselect.js"></script>
<link rel="stylesheet" href="dist2/css/bootstrap-multiselect.css" type="text/css"/>
<script type="text/javascript">
$(document).ready(function(){
$('#doc_1').multiselect();
});
</script>
推荐答案
在插入插件之前,您需要具有一个jquery库和bootstrap库:
you need to have a jquery library and bootstrap library before your plugin:
<!-- Include Twitter Bootstrap and jQuery: -->
<link rel="stylesheet" href="css/bootstrap.min.css" type="text/css"/>
<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/bootstrap.min.js"></script>
<!-- Include the plugin's CSS and JS: -->
<script type="text/javascript" src="js/bootstrap-multiselect.js"></script>
<link rel="stylesheet" href="css/bootstrap-multiselect.css" type="text/css"/>
注意:
您应该始终将CSS放在任何脚本之前.
Note:
You should always place your css before any script.
这篇关于bootstrap multiselect:TypeError:$(...).multiselect不是一个函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文