나는 가능한 한 내 문제를 단순화했습니다. Internet Explorer에서만 발생합니다 (9 및 10). 데이터는 무사 initChild
방법에 도착,IE 10 + KnockoutJS = HierarchyRequestError?
<html>
<body>
<span data-bind="text:$data[0].Mileage"></span>
<script type="text/javascript">
window.initChild = function (ko, viewModel) {
window.ko = ko;
ko.applyBindings(viewModel, document.body);
}
</script>
</body>
</html>
내 SPA가
var otherWindow = window.open('myurl', '_blank');
var handler = function() {
otherWindow.initChild(ko, report);
};
if (otherWindow.addEventListener) {
otherWindow.addEventListener('load', handler, false);
} else if (otherWindow.attachEvent) {
otherWindow.attachEvent('onload', handler);
}
내가 확인
를 호출 :이와 렌더링 된 페이지가 있습니다.페이지에 아무 것도 바인딩하지 않으면 applyBindings 호출에서 HierarchyRequestError
이 표시됩니다. 나의 google-fu는 이것에 완전하게 버렸다, 나는 틀린 무엇이 완전하게 우둔이다.
태그가 지정된 IE입니다. 다른 브라우저에서도 이러한 현상이 발생하지 않습니까? – Amy
아니요, 그렇지 않습니다. 이 코드는 FF와 Chrome에서 잘 작동합니다 (원래의 더 복잡한 코드). – TDaver
'$ data [0] .Mileage' 뷰 모델이 배열이 아닌 것 같습니다. – Tyrsius