I have this code to increment a jQuery UI progressbar but when I open this in Firefox, Firebug shows a error every time the setInterval function runs.
// 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);
The exact error I get from Firebug is:
loading is not defined
width = loading.width();
You declare
progressBarbut never use it.I think this is a mistake and you want to declare
loading