At the beginning of the backend, the data passed in was displayed normally. I don’t know how to display the data returned by ajax using an EJS template.
習慣沉默2017-06-24 09:45:10
ejs is used for the first rendering, ajax cannot be rendered with ejs
Give me the simplest example
<script>
var test = '<%= val %>'
</script>
After writing this, after your ejs is rendered and you inspect the element, you will find that the ejs syntax val in the js has been rendered as a fixed value
ejs is not an mvvm framework. The purpose of using ejs is to bring some data and reduce requests during the first rendering.
Otherwise, the method is to load the data for the first time, request, load, and then render the data