试过后,jquery confirm,现在jAlert,每次都遇到同样的错误。。 在控制台中,我得到 - TypeError: $.jAlert is not a function[了解更多]
<script src="js/jquery-3.3.1.min.js"></script>
<link href="css/jAlert.css" rel="stylesheet">
<script src="js/jAlert.js"></script>
<script src="js/jAlert-functions.js"></script>
我的按钮是...
<input type="radio" class="form-check-input" name="optionsRadios" id="mybtn" value="">
和脚本部分:
<script type="text/javascript">
$(document).ready(function(){
$('#mybtn').on('click',function(){
$.jAlert({
'title': 'Nice Size',
'content': 'This is the sized alert',
'theme':'blue',
'closeOnClick': true
});
});
</script>
我猜 jQuery 和 jAlert 是冲突的... 谁能帮忙?
最佳答案
如何使用 fn 来扩展 jquery 功能,这样你的代码就可以了
<script type="text/javascript">
$(document).ready(function(){
$('#mybtn').on('click',function(){
$.fn.jAlert({
'title': 'Nice Size',
'content': 'This is the sized alert',
'theme':'blue',
'closeOnClick': true
});
});
</script>
关于javascript - $.jAlert 不是函数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55084910/