firhome
V2EX  ›  Node.js

请教一下不用框架 jade 怎么使用?

  •  
  •   firhome · Jul 8, 2016 · 2605 views
    This topic created in 3622 days ago, the information mentioned may be changed or developed.
    我现在用法如下:
    var fn = jade.renderFile('./tmpl/index.jade',{
    cache:true,
    pretty:true
    },function(err,html){
    response.writeHead(200, {"Content-Type": "text/html"});
    console.log(html);
    response.write(html);
    response.end();
    });

    console.log 能正常显示,但是 页面一直在加载。 因为html里加个不存在的css,请问这种情况该怎么办呢?页面直接白屏的

    另外问一下。 jade. renderFile 和 jade. compileFile 什么区别呢?
    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5886 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 33ms · UTC 02:03 · PVG 10:03 · LAX 19:03 · JFK 22:03
    ♥ Do have faith in what you're doing.