8
使用jQuery从JavaScript对象添加/删除项目
我有一个JavaScript对象,如下所示: var data = {items: [ {id: "1", name: "Snatch", type: "crime"}, {id: "2", name: "Witches of Eastwick", type: "comedy"}, {id: "3", name: "X-Men", type: "action"}, {id: "4", name: "Ordinary People", type: "drama"}, {id: "5", name: "Billy Elliot", type: "drama"}, {id: "6", name: "Toy Story", type: "children"} ]}; 如果我想在此列表中添加/删除项目,我将如何使用jQuery进行处理?客户希望此列表是可动态修改的。