摘要: JS通过ajax请求servlet/url,虽然可以请求成功,但无法收到返回数据,javascript控制台有错误显示:XmlHttpRequest error: Origin null is not allowed by Access-Control-Allow-Origin解决方法: 1.请求的url是PHP的,需要PHP中echo:header('Access-Control-Allow-Origin: *'); 2.html的,需要<meta http-equiv="Access-Control-Allow-Origin" content=&q 阅读全文
posted @ 2012-04-07 19:25 木格袋子 阅读(1999) 评论(1) 推荐(0) 编辑