$.ajax({
type:"get",
url:"http://192.168.0.111:80/Index/index.php",
async:true,
success:function(res){
console.log(res)
},
error:function(err){
console.log("error:"+JSON.stringify(err));
}
});
在服务器下的文件可以用ajax访问到php文件
报错代码
XMLHttpRequest cannot load http://192.168.0.111/Index/in... No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8080' is therefore not allowed access
用vue脚手架写的,不用也一样报类似的错误
繁华开满天机
相关分类