0

我想知道为什么本教程使用 jquery 1.5 工作 1.9 它不...

http://jsfiddle.net/rniemeyer/QSRBR/

<div class='liveExample'> 

    <div data-bind='simpleGrid: gridViewModel'> </div>

    <button data-bind='click: addItem'>
        Add item
    </button>

    <button data-bind='click: sortByName'>
        Sort by name
    </button>

    <button data-bind='click: jumpToFirstPage, enable: gridViewModel.currentPageIndex'>
        Jump to first page
    </button>

</div>

有任何想法吗。

谢谢

4

3 回答 3

3

https://github.com/SteveSanderson/knockout/issues/503

https://github.com/SteveSanderson/knockout/pull/796

看起来 jQuery.clean 已从此版本中删除。淘汰赛使用的是未记录的 API,因此可能会发生这种情况。

于 2013-02-19T17:46:53.307 回答
2

根据这个讨论,这个问题应该已经用 Knockout 2.2.1 解决了。尝试更新到最新的稳定版 Knockout。

于 2013-02-19T17:48:44.743 回答
1

如果您对 jQuery 1.9 或 2.0 有任何问题,请阅读以下(非常重要!)更改日志:http: //jquery.com/upgrade-guide/1.9/

升级到 1.9 时很容易破坏遗留代码,尤其是在使用未记录的功能时。

于 2013-02-19T17:52:06.053 回答