开发者

Node.js not parsing external javascripts correctly

So the problem is that node.js doesn't send my javascript files correctly. I can find them in the html code, but they are not executed by the browser. Th开发者_StackOverflowose js files don't even appear in the firebug's NET panel when I reload the page.

I am using Express with Jade.

Any ideas how to fix this issue? Or what's causing it?


Make sure you have express.static set properly in app.configure.

app.configure(function(){
  app.set('views', __dirname + '/views');
  app.set('view engine', 'jade');
  app.use(express.bodyParser());
  app.use(express.methodOverride());
  app.use(app.router);
  app.use(express.static(__dirname + '/public'));
});

// Also, make sure you have the most updated versions of express and node.js. Both change often.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜