脚本和CSS文件不加载在节点JS?
我无法加载节点JS中的jQuery和CSS文件
public javascripts stylesheets
我有HTML文件,我读了在server.js如下
http.createServer(function (req, res) { res.writeHead(200, { 'Content-Type': 'text/html' }); fs.readFile('Views/index.html', 'utf8', function (error, data) { if (error) { res.writeHead(404); res.write('file not found'); } else { res.write(data); } res.end() }); }).listen(port);
如何正确加载脚本和css文件。
- Nodejs:服务的HTML页面没有链接到CSS
- 当在我的html脚本标签上使用async ='true'来加载socket.io.js时,会导致io对象的一个未定义的错误任何build议?
- 通过AJAX呈现Jade模板并尝试传递/访问与HTML分开的数据
- 在NodeJS中使用mp3文件以用于audio标签
- 使用Node,Express&EJS压缩HTML?
- 带有Autocomplete的HTML / CSS / iQuery编辑器
- 在循环中使用window.location插入数据时发生问题(GET方法)
- JSON + Node.js – 意外的令牌o
- cheerio用href和spanparsingh2