报错:跨域

 XMLHttpRequest cannot load http://localhost:8080/yxt-admin/admin/store. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://company.99kst.com:8088' is therefore not allowed access. 
网上查了查有两种解决方法
 在测试的时候是别的地址来访问的,所以在获取session的时候,把地址改成 http://company.99kst.com:8088/.....(因为我的是在上传文件的时候需要使用到)
解决办法:
1.页面请求的是自己写的一个servelet,加入response.setHeader("Access-Control-Allow-Origin", "*");
2.请求页面html,加入<meta http-equiv="Access-Control-Allow-Origin" content="*">
 

XMLHttpRequest cannot load – Origin is not allowed by Access-Control-Allow-Origin.的更多相关文章

  1. Access control allow origin 简单请求和复杂请求

    原文地址:http://blog.csdn.net/wangjun5159/article/details/49096445 错误信息: XMLHttpRequest cannot load http ...

  2. 解决js ajax跨越请求 Access control allow origin 异常

    // 解决跨越请求的问题 response.setHeader("Access-Control-Allow-Origin", "*");

  3. jquey XMLHttpRequest cannot load url.Origin null is not allowed by Access-Control-Allow-Origin

    此篇文章原文地址:http://blog.csdn.net/wangsky2/article/details/22961345 正文: 原文地址:http://stackoverflow.com/qu ...

  4. jquery读取本地文件,Windows上报错。XMLHttpRequest cannot load xxx. Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https, chrome-extension-resource.k.cors.a.c

    问题: 测试报告,使用本地的json.txt文件,结果文件读取失败,报错如下: XMLHttpRequest cannot load xxx. Cross origin requests are on ...

  5. nodejs报错 XMLHttpRequest cannot load localhost:3000/test_date/. Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https.

    z在请求本地的时候  如果ajax的URL 前面没有http的话 就会报错 jq.js:2 XMLHttpRequest cannot load localhost:3000/test_date/. ...

  6. angularjs flask跨域问题 XMLHttpRequest cannot load. No 'Access-Control-Allow-Origin'

    场景,我要来我的server(A)上用api来访问另一个server(B)的问题,如果直接在A上调用B的api,那么就会出现XMLHttpRequest cannot load. No 'Access ...

  7. Ajax 请求请求 MVC WebAPI跨域问题;XMLHttpRequest cannot load

    问题:XMLHttpRequest cannot load http://192.168.1.4:9010//api/contacts. The 'Access-Control-Allow-Origi ...

  8. XMLHttpRequest cannot load ...谷歌浏览器跨域问题

    HTML页面通过Ajax调用公网web服务时,浏览器请求发送成功,但是响应的 xhr.status==0,控制台报错如下 XMLHttpRequest cannot load http://ws.we ...

  9. Axiso解决跨域访问(...XMLHttpRequest cannot load http://xxx.xxx No 'Access-Control-Allow-Origin'...)

    直接访问如下:this.$axios.get("http://localhost:8089/yc/demo").then(res=>{    console.log(res) ...

随机推荐

  1. javaScript去除空格或换行

    js 去掉空格.回车.换行 1 releaseDesc = releaseDesc.replace(/\ +/g,"").replace(/[\r\n]/g,"" ...

  2. Proud Merchants

    Proud Merchants Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/65536 K (Java/Others) To ...

  3. SecureCRT issue "Could not open clipboard: Assess is denied" (无法打开粘贴板:访问被拒绝)

    I got an issue when copying some line/word (actually just select the context ) in the Linux terminal ...

  4. 模块shimgvw.dll已加载,但找不到入口点DllRegisterServer

    [环境]Windows 7 / Windows Server 2008 [现象]在文件夹浏览器中不能显示图片缩略图. [错误信息]查系统日志,有如下消息:“模块shimgvw.dll已加载,但找不到入 ...

  5. 同一服务器部署多个tomcat时的端口号修改详情

    同一服务器部署多个tomcat时,存在端口号冲突的问题,所以需要修改tomcat配置文件server.xml,以tomcat7为例. 首先了解下tomcat的几个主要端口: <Connector ...

  6. Jenkins构建Git manager服务器的源码

    1,下载scm manager 源码库管理,下载后解压即可: 2,运行bin目录下的scm-server.bat文件,启动服务: 3,建议将scm-server放在git客户端的安装目录下,方便管理 ...

  7. MySQL基础(四)——索引

    MySQL基础(四)--索引

  8. CodeForces 651C Watchmen map

    Watchmen are in a danger and Doctor Manhattan together with his friend Daniel Dreiberg should warn t ...

  9. tomcat和mysql安装配置总结

    我安装的tomcat和mysql都是解压缩版的.安装和配置tomcat倒没花费我多少时间,主要是mysql,几乎花费了我一天的时间. Tomcat安装总结: 首先将下载好的tomcat压缩包解压放在其 ...

  10. 编写一个Car类,具有final类型的属性品牌,具有功能drive; 定义其子类Aodi和Benchi,具有属性:价格、型号;具有功能:变速; 定义主类E,在其main方法中分别创建Aodi和Benchi的对象并测试对象的特 性。

    package b; public class Car { public final static Car pinpai=new Car(); public static Car instance() ...