SCRIPT438: 对象不支持“UpdateInfo”属性或方法
代码如下:
<script>
function StartProgress(progressIdValue) {
new ProggressUpdater().Start(progressIdValue, OnProgerssComplete);
}
function OnProgerssComplete() {
alert("complete");
}
function ProggressUpdater() {
this.progressWaiting = false;
this.timerId = null;
this.isComplete = true;
this.progerssComplete = null;
this.progressId = 0;
this.filePath = "";
this.processValue = 0;
this.errMessage = "";
this.startTime = new Date();
this.outTime = 3;//连接超时时间,单位分钟
this.Start = function (progressIdValue, progerssCompleteFunc) {
window.ProggressUpdaterInstance = this;
this.isComplete = false;
this.timerId = window.setInterval(this.ContinueProgress, 500);
this.progerssComplete = progerssCompleteFunc;
this.progressId = progressIdValue;
this.time = new Date();
};
this.End = function () {
if (this.timerId != null && this.timerId > -1)
window.clearInterval(this.timerId);
progressComplete();
};
this.ContinueProgress = function () {
if (this.progressWaiting) {
return;
}
this.progressWaiting = true;
if (!this.isComplete) {
var info = '{isComplete="1",filePath=[""],processValue="30",err=""}';
alert(info);
this.UpdateInfo(info);
if(this.isCompleted)
{
this.End();
}
}
this.progressWaiting = false;
};
this.UpdateInfo = function (aaa) {
alert(aaa);
var json = eval('(' + aaa + ')');
if(json.isCompleted==1)this.isCompleted =true;
else this.isCompleted =false;
this.filePath = json.filePath;
this.processValue = json.processValue;
this.errMessage = json.err;
};
}
StartProgress(11);
</script>
代码如下:
<script>
function StartProgress(progressIdValue) {
new ProggressUpdater().Start(progressIdValue, OnProgerssComplete);
}
function OnProgerssComplete() {
alert("complete");
}
function ProggressUpdater() {
this.progressWaiting = false;
this.timerId = null;
this.isComplete = true;
this.progerssComplete = null;
this.progressId = 0;
this.filePath = "";
this.processValue = 0;
this.errMessage = "";
this.startTime = new Date();
this.outTime = 3;//连接超时时间,单位分钟
this.Start = function (progressIdValue, progerssCompleteFunc) {
window.ProggressUpdaterInstance = this;
this.isComplete = false;
this.timerId = window.setInterval(this.ContinueProgress, 500);
this.progerssComplete = progerssCompleteFunc;
this.progressId = progressIdValue;
this.time = new Date();
};
this.End = function () {
if (this.timerId != null && this.timerId > -1)
window.clearInterval(this.timerId);
progressComplete();
};
this.ContinueProgress = function () {
if (this.progressWaiting) {
return;
}
this.progressWaiting = true;
if (!this.isComplete) {
var info = '{isComplete="1",filePath=[""],processValue="30",err=""}';
alert(info);
this.UpdateInfo(info);
if(this.isCompleted)
{
this.End();
}
}
this.progressWaiting = false;
};
this.UpdateInfo = function (aaa) {
alert(aaa);
var json = eval('(' + aaa + ')');
if(json.isCompleted==1)this.isCompleted =true;
else this.isCompleted =false;
this.filePath = json.filePath;
this.processValue = json.processValue;
this.errMessage = json.err;
};
}
StartProgress(11);
</script>


