我有以下代码:
...
</tr>
<!-- ko if: eLocBound() == 'true' -->
<tr>
<td>Select Locations <span class="required_star">*</span></td>
<td><input type="text" /></td>
</tr>
<!-- /ko -->
<tr>
...
这正确地显示在Chrome / Firefox / Safari。 然而,当我加载页面在IE 9,会出现以下错误:
Cannot find closing comment tag to match: ko if: eLocBound() == 'true'
当我检查在IE浏览器的开发者窗口的HTML输出,我发现IE浏览器实际上是嵌套<!-- ko if -->
以前的TR标签内 ,而不是在TR标签之间的注释标记,从而击倒无法找到匹配<!-- /ko -->
标签。 我已经联系到问题的屏幕截图在这里: http://imgur.com/nN7Ln
相反,如果我的代码改成这样:
<tr data-bind="visible: eLocBound() == 'true'">
<td>Select Locations <span class="required_star">*</span></td>
<td><input type="text" /></td>
</tr>
然后一切工作正常。 我只是想知道是否有人遇到这个问题与虚拟元素。