开发者

ASP.NET a question about AJAX library. The same code doesn't work on the 2nd machine

开发者 https://www.devze.com 2023-01-09 21:28 出处:网络
I have the same code which using jQuery\'s ajax method to update progress bar. The problem is, that the code works when is developed on Visual Studio 2010 Ultimate (1st machine, .NET Framework 4) and

I have the same code which using jQuery's ajax method to update progress bar. The problem is, that the code works when is developed on Visual Studio 2010 Ultimate (1st machine, .NET Framework 4) and doesn't wokr on Visual Studio 2008 Team Edition (2nd machine, .NET Framework 3.5). How's it possible ? Doesn't works - I mean that on the 1st machine progress bar is being updating, but on the 2nd machine is updated when the server side code finishes his work. I have AJAX Extensions 1.0 installed

Here's the jQuery code

$(document).ready(function () {

        $("#progressbar").progressbar({ value: 0 });

        var intervalID;

    开发者_高级运维    $("#<%=this.Button1.ClientID%>").click(
            function () {
                intervalID = setInterval(updateProgress, 3000); //get progress for each 3 sec
            }
        );

        function updateProgress() {
            $.ajax({
                type: "POST",
                url: "ProgressBar.aspx/GetProgress",
                data: "{}",
                contentType: "application/json; charset=utf-8",
                dataType: "json",
                async:true,
                success: function (msg) {
                    $("#result").text = msg.d;
                    var value = $("#progressbar").progressbar("option", "value");
                    if (value < 100) {
                        $("#progressbar").progressbar("value", msg.d);
                        $("#result").text(msg.d);
                    }
                    else clearInterval(intervalID);
                }
            });
        }
    });
0

精彩评论

暂无评论...
验证码 换一张
取 消