Node.js passing parameters to client via express render

后端 未结 4 442
温柔的废话
温柔的废话 2020-12-03 11:49

I\'m using Node.js and I\'m having issues communicating with a client.

I define Express:

var express             = require(\"express\");
var app              


        
4条回答
  •  误落风尘
    2020-12-03 12:18

    If you want to get parameters on the clientside via javascript, you should do template like this , otherwise variables aren't available

    If you use Jade, it will be something like this:

    script(type='text/javascript').
        var name = !{name}
    

提交回复
热议问题