对大家有帮助的问答会被标记为“推荐”,看完课程过来浏览一下别人提的问题,会帮你学得更全面
浮动出现问题后,p标签不应该被上面的ul盖住吗?为什么p中文本正好是出现在ul文本的后面呢
加入我想选择div中的最后一个p,那么是div p:last-chile吗?
安装完nodemon后,没有package.json
文件。在哪找到这个文件啊。
刚提出的问题已解决,是aplplication/json写错了, 也没报错
输入地址3030/getlist, 页面上的json数据一直无法出现,说无法相应数据
const http = require('http')
const url = require('url')
http.createServer(function (req, res) {
//获取请求路径
const {pathname} = url.parse(req.url);
if (pathname == '/') {
res.end('hello')
}else if (pathname == '/getlist') {
console.log("cccc")
res.writeHead(200, { "Content-Type": 'aplplication/json;' });
res.write(JSON.stringify({ records: [{ name: 'fyx' , age : 12}] }))
res.end()
}else{
res.writeHead(200, { 'Content-Type': 'text/plain; charset=utf-8' });
res.end('默认值')
}
}).listen('3030', function () {
console.log('服务器正在监听3030端口')
})
为什么累加后的data就不是buffer byte就是 一个string了啊
str += ALPHABET.charAt(rand);
用这个不是更简单吗?