search

Home  >  Q&A  >  body text

node.js - nodejs,express搭建,为什么ejs模板被解析成pre了?


最后也没找到任何问题,我只是修改了ejs模板跟静态js,所以很奇怪为什么会这样。最后重装了一次就好了。
这个问题好像大家也没遇到过,所以参考意义不大,请求关闭。

PHP中文网PHP中文网2786 days ago410

reply all(2)I'll reply

  • 怪我咯

    怪我咯2017-04-17 16:20:49

    It should be that something went wrong when you rendered the page. The data was not rendered normally when rendering the page, so the result is that the entire page's html was sent

    reply
    0
  • 巴扎黑

    巴扎黑2017-04-17 16:20:49

    Are you reading the file content directly and the ContentType is not set to text/html? If you have directly defined the template engine and directory, just res.rend(‘xxx’); will be fine

    reply
    0
  • Cancelreply