在IE中回发后javascript函数无法正常工作

时间:2013-09-18 10:52:36

标签: javascript jquery ajax

这是我的javascript函数

function generateProgressBar() {
        //generate progressbar of courses   
        debugger;
        $("div[class *= 'ProgressBar']").each(function () {
            var progressbar;
            progressbar = $(this),
            count = $(this).find("div[id *= 'CurrentCount']"),
            totalCount = $(this).find("div[id *= 'TotalCount']"),            
            description = $(this).find("div[class *= 'ProgressLabel']");
            progressbar.css({ 'float': 'right', 'margin-top': '5px', 'padding-right': '5px' });
            progressbar.width(120);
            count.css({ 'display': 'none' });
            totalCount.css({ 'display': 'none' });
            description.css({'margin-top': '-5px','position':'absolute','left': '20%','font-size':'11px','text-shadow': '1px 1px 0 #fff' });
            description.text(count.text() + " ouf of " + totalCount.text());
            var per = (parseInt(count.text()) / parseInt(totalCount.text())) * 100;
            progressbar.progressbar({
                value: per,
                change: function () {
                    description.text(count.text() + " out of " + totalCount.text());
                },
                complete: function () {
                    description.text(count.text() + " out of " + totalCount.text());
                },

            });
        });
}

我已经在异步回发上调用了这个函数,如下所示。

Sys.WebForms.PageRequestManager.getInstance().add_endRequest(generateProgressBar);

上面的函数在firefox中运行正常。在IE的情况下,它首先生成进度条,但在异步回发时它不生成进度条。我该如何解决这个问题?

0 个答案:

没有答案