我正在使用UpdatePanel
将ActiveView
换成MultiView
。使用ASP.NET UpdatePanel时出现JavaScript错误
在IE6,7和8以及Chrome 7中,UpdatePanel返回时出现JavaScript错误。在Firefox 3.6.1中没有错误报告(在错误控制台或Firebug中)。
的错误是对的ScriptResource.axd的3621线
function Sys$_ScriptLoader$_loadScriptsInternal() {
var session = this._currentSession;
if (session.scriptsToLoad && session.scriptsToLoad.length > 0) {
var nextScript = Array.dequeue(session.scriptsToLoad);
var scriptElement = this._createScriptElement(nextScript);
if (scriptElement.text && Sys.Browser.agent === Sys.Browser.Safari) {
scriptElement.innerHTML = scriptElement.text;
delete scriptElement.text;
}
if (typeof(nextScript.src) === "string") {
this._currentTask = new Sys._ScriptLoaderTask(scriptElement, this._scriptLoadedDelegate);
this._currentTask.execute();
}
else {
var headElements = document.getElementsByTagName('head');
if (headElements.length === 0) {
throw new Error.invalidOperation(Sys.Res.scriptLoadFailedNoHead);
}
else {
line 3621: headElements[0].appendChild(scriptElement);
}
Sys._ScriptLoader._clearScript(scriptElement);
this._loadScriptsInternal();
}
}
else {
this._stopSession();
var callback = session.allScriptsLoadedCallback;
if(callback) {
callback(this);
}
this._nextSession();
}
}
Chrome的开发人员工具显示,headElements
是NodeList
一个元素和scriptElement
是HTMLScriptElement
可能是这个错误的原因是什么?为什么只在IE和Chrome中显而易见,而不是Firefox?
最有可能的是,在代码中的东西。你可以在你正在交换的地方分享代码吗? – 2010-11-29 03:00:48