Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/74.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 你知道为什么我会得到$().progessbar在我的MVC应用程序中不是一个函数吗_Javascript_Html_Model View Controller - Fatal编程技术网

Javascript 你知道为什么我会得到$().progessbar在我的MVC应用程序中不是一个函数吗

Javascript 你知道为什么我会得到$().progessbar在我的MVC应用程序中不是一个函数吗,javascript,html,model-view-controller,Javascript,Html,Model View Controller,以下是实际错误: Uncaught TypeError: jquery-3.1.1.min.js:2 $(...).progressbar is not a function at HTMLDocument.<anonymous> (microsite.js:21) uncaughttypeerror:jquery-3.1.1.min.js:2 $(…)。progressbar不是函数 在HTMLDocument。(microsite.js:21) 这里是在tmy标题中定

以下是实际错误:

Uncaught TypeError: jquery-3.1.1.min.js:2
$(...).progressbar is not a function
    at HTMLDocument.<anonymous> (microsite.js:21)
uncaughttypeerror:jquery-3.1.1.min.js:2
$(…)。progressbar不是函数
在HTMLDocument。(microsite.js:21)
这里是在tmy标题中定义我的脚本js的地方:

<script src="/Scripts/jquery-3.1.1.min.js"></script>
    <script src="/Scripts/bootstrap.min.js"></script>
    <script src="/Scripts/microsite.js"></script>
    <script src="/Scripts/custom.js"></script>
    <script src="/Scripts/owl.carousel.js"></script>

下面是microsite.js中的实际错误代码

$(document).ready(function () {
    $('#pledgeBar').progressbar({
        disabled: true,
        change: function () {
            var val = $(this).progressbar("option", "value") || 0;
            var valTxt = '' + val;
            valTxt = valTxt.replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1,")
            var percentVal = 0
            if ($(this).progressbar("option", "max") != 100) {
                percentVal = val / $(this).progressbar("option", "max") * 100;
            }
            if (percentVal < 15) {
                $(this).find('.ui-progressbar-value').html('<div class="label label-reverse hidden-xs"><img src="/common/images/GreatAmericanCampout/pledgebar-indicator.png" width="17" height="10" alt="goal indicator" /> ' + valTxt + '</div>');
            } else {
                $(this).find('.ui-progressbar-value').html('<div class="label hidden-xs">' + valTxt + '<img src="/common/images/GreatAmericanCampout/pledgebar-indicator.png" width="17" height="10" alt="goal indicator" /></div>');
            }
            var maxTxt = '' + $('#pledgeBar').progressbar("option", "max");
            $('.thermometer .goal').html(maxTxt.replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1,") + '<br/>campers');
        }
    });

    if (pledgeBarConfig != undefined) {
        $('#pledgeBar').progressbar("option", "disabled", false);
        $('#pledgeBar').progressbar("option", "max", pledgeBarConfig.max); // update the max
        $('#pledgeBar').progressbar("option", "value", pledgeBarConfig.val); // update the value
    };
});
$(文档).ready(函数(){
$(“#抵押银行”).progressbar({
残疾人:对,,
更改:函数(){
var val=$(this).progressbar(“选项”、“值”)| | 0;
var VALCTXT=''+val;
valTxt=valTxt.replace(/(\d)(?=(\d\d\d)+(?!\d))/g,“$1”)
var percentVal=0
如果($(此).progressbar(“选项”,“最大值”)!=100){
percentVal=val/$(此).progressbar(“选项”,“最大值”)*100;
}
如果(百分比值<15){
$(this.find('.ui progressbar value').html(''+valTxt+'');
}否则{
$(this.find('.ui progressbar value').html(''+valTxt+'');
}
var maxTxt='+$('#抵押银行').progressbar(“期权”,“最大”);
$('.temperator.goal').html(maxTxt.replace(/(\d)(?=(\d\d\d)+(?!\d))/g,“$1,”)+”
campers'); } }); if(质权配置!=未定义){ $(“#抵押银行”).progressbar(“选项”,“禁用”,false); $(“#质权银行”).progressbar(“选项”,“最大值”,质权银行配置.max);//更新最大值 $(“#质权银行”).progressbar(“选项”,“值”,质权银行配置.val);//更新值 }; });
我已经删除了$(document.ready),但仍然会出现同样的错误


如果您有任何建议,我们将不胜感激

您加载的各种JS库中有哪些是用来包含progressbar小部件的?错误是代码中没有这样的东西。你确定加载了正确的文件吗?progressBar是一个插件吗?
bootstrap.js
没有
.progressBar
函数,这似乎是在
microsite.js
之前加载的唯一库;在加载任何调用该函数的代码之前,请确保加载了包含
progressbar()
函数的代码。如果使用jQuery UI中的进度条,则需要加载jQuery UI。并确保在jQuery之后加载它。谢谢,这些都是很好的评论。我解决问题后会通知你的