nodejs ajax 不适用框架的情况下转域报错
发布于 9 年前 作者 lhist 4358 次预览 最后一次回复是 9 年前 来自 问答
if(req.url!=="/favicon.ico"){ console.log(“here is ok”); res.writeHead(200,{“Content-Type”:“text/plain”,“Access-Control-Allow-Origin”:“http://localhost:”}); res.header(“Access-Control-Allow-Origin”,"*"); res.send(fileb); } 为什么运行时报错: res.header is not a function
6 回复
@thesadboy 应该怎么设置?
@thesadboy 我用express就好了,谢谢啊
res.header 是哪门子写法?