我有一个 json 文件,我想构建一个允许我在文件中添加/编辑元素的表单。是否有一个 jQuery 函数/方法可以让我能够在外部 json 文件中发布和附加元素?
不确定这是否会有所帮助,但当前的 json 结构如下:
[ { "cast" : "",
"director" : "",
"genre" : "",
"id" : false,
"nrVotes" : 0,
"plot" : "",
"rating" : 0,
"runtime" : 0,
"title" : "",
"year" : false
},
{ "cast" : "Tim Robbins, Morgan Freeman, Bob Gunton, ",
"director" : "Frank Darabont",
"genre" : "Crime Drama ",
"id" : "0111161",
"nrVotes" : 968510,
"plot" : "Two imprisoned men bond over a number of years, finding solace and eventual redemption through acts of common decency.",
"rating" : 9.3000000000000007,
"runtime" : 142,
"title" : "The Shawshank Redemption",
"year" : "1994"
}]