如果多个脚本同时定时访问,容易引发脚本异常,没下就记下来了。
代码
</script>
<script type="text/javascript">
function WebForm_CallbackComplete_SyncFixed() {
for (var i = 0; i < __pendingCallbacks.length; i++) {
callbackObject = __pendingCallbacks[ i ];
if (callbackObject && callbackObject.xmlRequest && (callbackObject.xmlRequest.readyState == 4)) {
if (!__pendingCallbacks[ i ].async) {
__synchronousCallBackIndex = -1;
}
__pendingCallbacks[i] = null;
var callbackFrameID = "__CALLBACKFRAME" + i;
var xmlRequestFrame = document.getElementById(callbackFrameID);
if (xmlRequestFrame) {
xmlRequestFrame.parentNode.removeChild(xmlRequestFrame);
}
WebForm_ExecuteCallback(callbackObject);
}
}
}
window.onload = function(){
if (typeof (WebForm_CallbackComplete) == "function") {
WebForm_CallbackComplete = WebForm_CallbackComplete_SyncFixed;
}}
</script>
<script type="text/javascript">
function WebForm_CallbackComplete_SyncFixed() {
for (var i = 0; i < __pendingCallbacks.length; i++) {
callbackObject = __pendingCallbacks[ i ];
if (callbackObject && callbackObject.xmlRequest && (callbackObject.xmlRequest.readyState == 4)) {
if (!__pendingCallbacks[ i ].async) {
__synchronousCallBackIndex = -1;
}
__pendingCallbacks[i] = null;
var callbackFrameID = "__CALLBACKFRAME" + i;
var xmlRequestFrame = document.getElementById(callbackFrameID);
if (xmlRequestFrame) {
xmlRequestFrame.parentNode.removeChild(xmlRequestFrame);
}
WebForm_ExecuteCallback(callbackObject);
}
}
}
window.onload = function(){
if (typeof (WebForm_CallbackComplete) == "function") {
WebForm_CallbackComplete = WebForm_CallbackComplete_SyncFixed;
}}
</script>
相关文章
暂无评论...