我有一个 json 文件,employees.json,我想将数据附加到这个对象。该文件如下所示:
var txt = '{"employees":[' +
'{"firstName":"Jerry","lastName":"Negrell","time":"9:15 am","email":"jerry@bah.com","phone":"800-597-9405","image":"images/jerry.jpg" },' +
'{"firstName":"Ed","lastName":"Snide","time":"9:00 am","email":"edward@bah.com","phone":"800-597-9406","image":"images/ed.jpg" },' +
'{"firstName":"Pattabhi","lastName":"Nunn","time":"10:15 am","email":"pattabhi@bah.com","phone":"800-597-9407","image":"images/pattabhi.jpg" }'+
']}';
我想附加:
- 名字:迈克
- 姓氏:车辙
- 时间:上午10:00
- 电子邮件:rut@bah.com
- 电话:800-888-8888
- 图片:图片/mike.jpg
到雇员.json。
我将如何做到这一点?