简体   繁体   English

KnockoutJS数据绑定从IE7和IE8删除元素

[英]KnockoutJS data-binding drops elements from IE7 and IE8

I am attempting to bind four properties to a fairly straight-forward HTML structure. 我试图将四个属性绑定到一个相当简单的HTML结构。 Everything is peaches in FF11, Chrome18 and IE9 until I load the page in IE7/IE8 (by changing the Browser and Coument Modes in IE9's version of developer tools). 在FF11,Chrome18和IE9中一切都是桃子,直到我在IE7 / IE8中加载页面为止(通过在IE9版本的开发人员工具中更改浏览器和Coument模式)。

Simple HTML structure - just outputs four rows of bound data. 简单的HTML结构-仅输出四行绑定数据。 A label and the bound data. 标签和绑定数据。

<div id="loyaltyProgramSummary" class="content-block clearfix" data-bind="with: CustomerPoints">
    <div class="form-row">
        <div>PricingGroup:</div>
        <div><span data-bind="text:PricingGroupName"></div>
    </div>
    <div class="form-row">
        <div>LifetimePointsToDate:</div>
        <div><span data-bind="text:LifetimePoints"></div>
    </div>
    <div class="form-row">
        <div>PointsUsed:</div>
        <div><span data-bind="text:RedeemedPoints"></div>
    </div>
    <div class="form-row">
        <div>AvailablePoints:</div>
        <div><span data-bind="text:AvailablePoints"></div>
    </div>
</div>

The first row, "PricingGroupName" is a ko.computed field and is the one that ends up getting dropped. 第一行“ PricingGroupName”是ko.computed字段,是最后被删除的字段。 When I look at the rendered HTML in the IE9 dev tools it has been omitted completely. 当我在IE9开发工具中查看呈现的HTML时,它已被完全省略。

   <div id="loyaltyProgramSummary" class="content-block clearfix" data-bind="with:CustomerPoints" __ko__1335910690335="ko3">            
       <div class="form-row" __ko__1335910690335="ko4">
            <div>LifetimePointsToDate:</div>
            <div><span data-bind="text:LifetimePoints" __ko__1335910690335="ko5">1000</div>
        </div>
        <div class="form-row" __ko__1335910690335="ko8">
            <div>PointsUsed:</div>
            <div><span data-bind="text:RedeemedPoints" __ko__1335910690335="ko6">1550</div>
        </div>
        <div class="form-row" __ko__1335910690335="ko9">
            <div>AvailablePoints:</div>
            <div><span data-bind="text:AvailablePoints" __ko__1335910690335="ko7">8450</div>
        </div>
    </div>

I thought it might have had something to do with the computed column but the "Available Points" is also a computed field and it functions perfectly. 我认为它可能与计算列有关,但是“可用点”也是计算域,并且功能完善。

I have created a "fiddle" illustrating the issuewhich can be found here ... 我创建了一个“小提琴”来说明可以在这里找到的问题 ...

Any help would be GREATLY appreciated! 任何帮助将不胜感激!

Thank You, Gary 谢谢你,加里

Don't use empty self-closing tags, change to . 不要使用空的自动关闭标签,改为。 http://jsfiddle.net/UXA4Q/13/ http://jsfiddle.net/UXA4Q/13/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM