admin管理员组文章数量:1323330
I have a jquery script to show modal form
<link rel="stylesheet" href=".3.6/css/bootstrap.min.css">
<script src=".1.3/jquery.min.js"></script>
<script src=".3.6/js/bootstrap.min.js"></script>
<script>
$(document).ready(function(){
$(".manipulate").click(function(){
$('#id_description').val();
var item_keys = ['#id_counter', '#id_first_name','#id_middle_name', '#id_last_name', '#id_display_name', '#id_field', '#id_loa_price', '#id_basic_cert_price', '#id_written_appraisal_cost']
for(var i=1; i<12; i++){
var item_val = $(this).parent().parent().find('td:nth-child('+i+')')[0].innerText;
console.log("InnerText is :"+ item_val);
$(item_keys[i-1]).val(item_val);
}
$('#id_item').val($(this).attr('item_id'));
$('#edititemModal').modal("show");
});
});
</script>
If i click the edit button to show the modal form i get .modal not a function.
I have a jquery script to show modal form
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn./bootstrap/3.3.6/css/bootstrap.min.css">
<script src="https://ajax.googleapis./ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script src="http://maxcdn.bootstrapcdn./bootstrap/3.3.6/js/bootstrap.min.js"></script>
<script>
$(document).ready(function(){
$(".manipulate").click(function(){
$('#id_description').val();
var item_keys = ['#id_counter', '#id_first_name','#id_middle_name', '#id_last_name', '#id_display_name', '#id_field', '#id_loa_price', '#id_basic_cert_price', '#id_written_appraisal_cost']
for(var i=1; i<12; i++){
var item_val = $(this).parent().parent().find('td:nth-child('+i+')')[0].innerText;
console.log("InnerText is :"+ item_val);
$(item_keys[i-1]).val(item_val);
}
$('#id_item').val($(this).attr('item_id'));
$('#edititemModal').modal("show");
});
});
</script>
If i click the edit button to show the modal form i get .modal not a function.
Share edited May 26, 2016 at 14:50 rrk 15.9k4 gold badges30 silver badges47 bronze badges asked May 26, 2016 at 14:46 ucheuche 852 gold badges2 silver badges14 bronze badges 3- 3 If you add the mark up, it will be very useful. – rrk Commented May 26, 2016 at 14:50
- Works fine here: jsfiddle/jn81w7ym/1, make sure you are including bootstrap correctly. – ak_ Commented May 26, 2016 at 15:04
- Possible duplicate of Bootstrap modal: is not a function – Anph Commented Sep 11, 2017 at 7:44
2 Answers
Reset to default 4<script type="text/javascript">
not
<script>
Also follow the right order: Bootstrap modal: is not a function
I resolved it after adding the library inside the index.js.We think you need this liabrary,bootstrap.js please add inside the index.js and i hope your code works will fine.
本文标签: javascriptUncaught TypeError ()modal is not a function jqueryStack Overflow
版权声明:本文标题:javascript - Uncaught TypeError: $(...).modal is not a function jquery - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742141313a2422590.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论