使用mockAPI使用纯javascript进行CRUD操作

时间:2018-02-23 16:49:28

标签: javascript ajax rest post get

我构建了一个纯poc javascript ajax app,它有get和post方法来操作响应。     需要涵盖的方案:

 1. If I have static JSON data already in webservice on load the GET method should get the response and build a dynamic table accordingly
 2. If I found no data in response I will ask the user to submit their datas to create response with the payload and build table dynamically
 3. If I have already built table and the user wants to submit additional record to add it has to be posted and with that response the new table row has to be inserted.

我有构建函数来处理动态表创建。我已经介绍了两种获取和发布数据的方案。但是当我尝试第三种情况时,构建表函数从头开始构建表。我希望函数能够处理第三种情况,它应该在表中单独添加特定数据行,而不是再次创建整个表。

请找到以下内容。

crud js ajax

0 个答案:

没有答案