nodejs ajax 不适用框架的情况下转域报错
发布于 8 年前 作者 lhist 3732 次浏览 来自 问答

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

3 回复

@thesadboy 应该怎么设置?

@thesadboy 我用express就好了,谢谢啊

res.header 是哪门子写法?

回到顶部