报错:跨域

 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. DelegateCommand.cs

    using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.W ...

  2. 记一次SortedDictionary的不当使用

    起初想用SortedDictionary做游戏中的排行榜,代码如下: using UnityEngine; using System; using System.Collections; using ...

  3. JAVA基础知识之JVM-——使用反射生成并操作对象

    Class对象可以获取类里的方法,由Method对象表示,调用Method的invoke可以执行对应的方法:可以获取构造器,由Constructor对象表示,调用Constructor对象的newIn ...

  4. Entity Framework 第三篇 实体特性声明

    Entity Framework中对实体的特性声明有着严格的要求 1.实体必须要有主键特性,但是如果实体没有主键特性那怎么办? public int ExecuteSqlCommand(string ...

  5. bnu A Matrix 北京邀请赛A题

    A Matrix Time Limit: 2000ms Memory Limit: 65536KB   64-bit integer IO format: %lld      Java class n ...

  6. (4)Redis 资料

    Redis是一种面向“键/值”对类型数据的分布式NoSQL数据库系统,特点是高性能,持久存储,适应高并发的应用场景. Redis Home http://redis.io/ MSOpenTech/re ...

  7. Duilib实现GroupBox控件

    转载:http://blog.csdn.net/asd313346541/article/details/47055113 原作者的源码上说:右边线和下边线显示不出来: 后来经过调试研究测试猜测应该是 ...

  8. 使用Windows安装的最高版本IE内核加载内嵌页(转载)

    客户端程序内嵌Webbrowser控件时,默认情况都是使用IE7兼容模式打开网页的.但是IE7有很多新的特性不支持,导致无法正常显示出来,所以需要强制使用高版本的IE内核来加载.渲染. void Ch ...

  9. CentOS7安装Docker,运行Nginx镜像、Centos镜像

    摘要 总体思路:yum命令直接安装Docker,下载想要的镜像并启动 1.环境,CentOS7 Minimal 64位,Docker必须要64位的系统 2.通过yum命令直接安装,yum instal ...

  10. join(添加字符)与id显示

    #!/usr/bin/env python li = ["alex",'sb'] l1 = "_".join(li) print(l1) print(id(li ...