XMLHttpRequest cannot load httplocalhost8090xuexipoccharge. No 'Access-Control-Allow-Origin' header

本文主要是介绍XMLHttpRequest cannot load httplocalhost8090xuexipoccharge. No 'Access-Control-Allow-Origin' header,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

XMLHttpRequest cannot load httplocalhost8090xuexipoccharge. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http192.168.1.1418090' is therefore not allowed access.
  使用Ajax可以访问到后台,后台也不报错,但是页面报上面这个错,在网上查了点资料,说是跨域访问,各种解决办法,但是我的和他们的错误不相同,所以解决不了!
  我的错是因为在浏览器使用的ip访问,而Ajax代码中url使用localhost访问,导致跨域问题!在页面中使用localhost访问就正常了,和代码无关,在这里提供给大家,你如果和我的错误相同,这样就可以解决了!
  如果有不足之处,欢迎补充!

这篇关于XMLHttpRequest cannot load httplocalhost8090xuexipoccharge. No 'Access-Control-Allow-Origin' header的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/1082021

相关文章

【ASP.NET】 No 'Access-Control-Allow-Origin' header is present on the requested resource.

前端JS用XMLHttpRequest,请求后端数据。出现了No ‘Access-Control-Allow-Origin’ header is present on the requested resource. 我是使用的ASP.NET框架。 解决办法: 在Web.config文件相应地方添加: <?xml version="1.0" encoding="utf-8"?><confi

nginx 8051#0: *4 recv() failed (104: Connection reset by peer) while reading response header from u

环境    php7   nginx1.8.0    nginx   报错  500  GATWAY网关错误 2017/08/28 10:45:42 [error] 7975#0: *333 recv() failed (104: Connection reset by peer) while reading response header from upstream, clien

vue dist文件打开index.html报Failed to load resource: net::ERR_FILE_NOT_FOUND

本地正常。打包好的dist文件打开index.html报Failed to load resource: net::ERR_FILE_NOT_FOUND 解决办法: 在webpack.prod.conf.js 中output添加参数publicPath:’./’ 在webpack.base.conf.js里 publicPath: process.env.NODE_ENV === ‘pro

Failed to load the JNI shared library D:\Program Files\Java\jdk1.5.0_08\bin\..\jre\bin\client\jvm.d

原因是 (外形类型向日葵) eclips要求jdk最低的版本为1.7以上

IDEA 中 Maven 报错 Cannot resolve xxx(全网试完,亲测有效的方法汇总)

问题: pom中已经添加相关依赖,maven刷新也没有用,依旧是疯狂报错。 可能原因: 在IDEA中的pom文件中添加了依赖,并且正确加载了相应依赖,pom文件没有报红,看起来像是把所有依赖库全部加载进来了,但是代码中使用依赖的类库使报红。 在pom中添加了某个依赖,不会直接立刻马上将其下载并且添加到项目的external libraries中。只有在某个子模块的pom文件中也添加了

Failed to load resource: the server responded with a status of 404

搞来搞去附件下载请求的地址老包404,我用的easyui1.5   引用下载插件 <script type="text/javascript" src="${ctx}/js/fileUploadOver.js"></script> 注意后期版本有所改动,没了  success: function(data, status)  //服务器成功响应处理函数

Nginx 配置access_by_lua返回状态码和参数

1、介绍 access_by_lua是nginx权限访问控制的一个模块,通过配置相关参数可以达到访问应用权限控制的目的 2、示例 ngx.header.content_type = "application/json;charset=utf8" 控制返回数据的类型ngx.say用来返回数据ngx.exit退出并返回状态码 location ~*\/api/v4/(objects|warni

“*** error 65: access violation at 0x40021000 : no 'read' permission”错误的解决

错误原因: 在Keil5下面进行模拟运行的时候总是点击一下Run,程序才走一步,还从时钟配置里面出不来。 解决办法: 第一种方法 : Option->Debug->Use_Simulator->Initialization_File,打开并新建一个.ini文件,里面写上map 0x40000000,0x400FFFFF read write保存即可(MAP不区分大小写,注意read和wri

windows下mysql修改 my.ini的datadir后 `Access denied`

1. 背景 window安装mysql数据库时,不能指定数据文件存放位置(默认安装路径 "C:/ProgramData")。 只能通过修改mysql.ini来更改数据文件存放目录。 2. 问题: 修改mysql.ini后,mysql 出现 "Access denied for user ‘root‘@‘localhost‘ (using password: YES)"。

Access restriction: The type 'XXX' is not API (restriction on required library 'C:\Progra

1.问题 Eclipse 编译错误: Access restriction: The type 'xxx' is not API (restriction on required library 'C:\Progra。。。 我引入一个    import sun.misc.ProxyGenerator;  但是Eclispe编译报错,但是java的jre确实有该包。 2.解决方法