Update the todo list without refreshing the page in express nodejs app

前端 未结 2 1118
囚心锁ツ
囚心锁ツ 2021-02-06 19:53

I am a newbee to the express nodejs applications. I want to make a todo list. This is how it looks so far. My question is when I add a todo, it takes some time to show the chang

2条回答
  •  轮回少年
    2021-02-06 20:12

    Your server should return JSON instead of rendered HTML. On the front end you should use JavaScript (jQuery and method $.getJSON() for example) to query your server for the updated task list. jQuery will use AJAX to send and receive data from your server without the need to refresh your page. There are many good tutorials online on how to make REST API using Node.js.

提交回复
热议问题