Accessing EJS variable in Javascript logic

后端 未结 6 475
不知归路
不知归路 2020-12-02 20:21

I\'m working on a Node.js app (it\'s a game). In this case, I have some code set up such that when a person visits the index and chooses a room, he gets redirected to the pr

6条回答
  •  攒了一身酷
    2020-12-02 21:07

    This works for me.

    // bar chart data
        var label = '<%- JSON.stringify(bowlers) %>';
        var dataset = '<%- JSON.stringify(data) %>';
    
        var barData = {
          labels: JSON.parse(label),
          datasets: JSON.parse(dataset)
        }
    

提交回复
热议问题