示例 JSON:https ://gist.github.com/mekkoo/6604902
我想使用 $.observable().insert 方法来对象内部数组“项目”。但是,我在方法调用时看到了错误“未捕获的类型错误:对象#没有方法'插入'”
pages = //Sample JSON $.ajax calling
$.observable(pages).insert(pages.length, {
//I want this data to insert to "items" array
"item": {
"id": 3,
"item_name": "Item Name 3",
"item_desc": "Item Desc 3",
"item_img": "http://example.com/sample.png"
},
"values": [
{
"id": 0,
"key_id": 0,
"value": "Value 0"
},
{
"id": 1,
"key_id": 1,
"value": "Value 1"
},
{
"id": 2,
"key_id": 2,
"value": "Value 2"
}
]
});