Javascript IE8淘汰3.3.0错误
我不确定是什么原因导致了它,但IE8指出这段代码中的catch行导致了一个错误,导致页面无法加载。我真的不知道是什么引起的。我甚至将所有保留的关键字都用引号括起来,以避免在淘汰中出现冲突Javascript IE8淘汰3.3.0错误,javascript,knockout.js,internet-explorer-8,Javascript,Knockout.js,Internet Explorer 8,我不确定是什么原因导致了它,但IE8指出这段代码中的catch行导致了一个错误,导致页面无法加载。我真的不知道是什么引起的。我甚至将所有保留的关键字都用引号括起来,以避免在淘汰中出现冲突 ko.utils.arrayForEach(orderedBindings, function(bindingKeyAndHandler) { // Note that topologicalSortBindings has already filtered out any nonexistent bi
ko.utils.arrayForEach(orderedBindings, function(bindingKeyAndHandler) {
// Note that topologicalSortBindings has already filtered out any nonexistent binding handlers,
// so bindingKeyAndHandler.handler will always be nonnull.
var handlerInitFn = bindingKeyAndHandler.handler["init"],
handlerUpdateFn = bindingKeyAndHandler.handler["update"],
bindingKey = bindingKeyAndHandler.key;
if (node.nodeType === 8) {
validateThatBindingIsAllowedForVirtualElements(bindingKey);
}
try {
// Run init, ignoring any dependencies
if (typeof handlerInitFn == "function") {
ko.dependencyDetection.ignore(function() {
var initResult = handlerInitFn(node, getValueAccessor(bindingKey), allBindings, bindingContext['$data'], bindingContext);
// If this binding handler claims to control descendant bindings, make a note of this
if (initResult && initResult['controlsDescendantBindings']) {
if (bindingHandlerThatControlsDescendantBindings !== undefined)
throw new Error("Multiple bindings (" + bindingHandlerThatControlsDescendantBindings + " and " + bindingKey + ") are trying to control descendant bindings of the same element. You cannot use these bindings together on the same element.");
bindingHandlerThatControlsDescendantBindings = bindingKey;
}
});
}
// Run update in its own computed wrapper
if (typeof handlerUpdateFn == "function") {
ko.dependentObservable(
function() {
handlerUpdateFn(node, getValueAccessor(bindingKey), allBindings, bindingContext['$data'], bindingContext);
},
null,
{ disposeWhenNodeIsRemoved: node }
);
}
} catch (ex) {
ex.message = "Unable to process binding \"" + bindingKey + ": " + bindings[bindingKey] + "\"\nMessage: " + ex.message;
throw ex;
}
});
如果您在项目中使用了Knockout.js,那么在某些时候您可能会遇到以下错误“uncaughtreferenceerror:无法处理绑定”。最可能的原因是某处输入错误或忘记更改上下文。。例如,您在foreach绑定中,忘记使用$parent
这可能会导致进一步的innerHtml错误,从而阻止页面加载js。引发/显示的实际错误是什么?您可以共享更多代码吗?你的装订是什么样子的?错误是怎么说的?@dperry
对象不支持此属性或方法
@RPNiemeyer我正在调试一个非常古老的东西,有太多东西无法精确地说明它的来源。嗯,无意冒犯,但是如果你不能将它缩小到一个尽可能小的复制,您希望我们如何帮助您?出现故障的绑定是什么样子的?