loading a knockout.js observableArray() from .ajax() call

后端 未结 5 1187
半阙折子戏
半阙折子戏 2021-02-01 20:10

This puzzles me. It must be something small I\'m not seeing. I\'m trying to load a very simple observableArray in knockout with an ajax call.

javasc

5条回答
  •  鱼传尺愫
    2021-02-01 20:40

    There is no reason this would not work fine. As this demonstrates.

    http://jsfiddle.net/madcapnmckay/EYueU/

    I would check that the ajax post is actually returning json data and that that json is an array and that it's being parsed correctly.

    I had to tweak the ajax call to get the fiddle ajax handlers to work correctly.

    Nothing more I can think of.

    Hope this helps.

提交回复
热议问题