The object is sent from the backend. How should the front-end js accept further processing?

< H2 > for example, if I send a video result in here, I want to call the backend interface through the ajax method again to generate its thumbnail. How can I pass video as a parameter to the pug template used by ajax,? thank you < / H2 >
Mar.12,2021
The rule of

ajax seems to be that you can only transfer json data. In the past, there were xml, but now they all use json. Take a look at how to convert video to json object first, and then use ajax to transfer


//node
 res.json(video);
//ajax
 $.post('/api',{},function(video){
     console.log(video);
  });
.
Menu