gpt4 book ai didi

javascript - “加载”未定义

转载 作者:行者123 更新时间:2023-11-30 18:38:07 25 4
gpt4 key购买 nike

我有这段代码来增加 jQuery UI 进度条,但是当我在 Firefox 中打开它时,Firebug 每次运行 setInterval 函数时都会显示错误。

// show progress on progressbar
$(function() {
$( "#loading" ).progressbar({
value: 0
});
});

//increment progressbar
var progressBar = $('#loading'),
width = loading.width();

var interval = setInterval(function() {

width += 1;

loading.css('width', width + '%');

if (width >= 100) {
clearInterval(interval);
loadContent();
}
}, 75);

我从 Firebug 得到的确切错误是:

loading is not defined
width = loading.width();

最佳答案

您声明了 progressBar 但从不使用它。我认为这是一个错误,您想声明 loading

//increment progressbar
var loading = $('#loading'),
width = loading.width();

关于javascript - “加载”未定义,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7658202/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com