简体   繁体   English

Access-Control-Allow-Origin不允许使用原点null

[英]Origin null is not allowed by Access-Control-Allow-Origin

i got this problem any one there to help me solve this problem, this is really aching. 我遇到了这个问题,任何人都可以帮助我解决这个问题,这真的很痛苦。 I am using swipejs for the carousal on ipad, so it works fine till i am not including jquery.js but when i include the jquery.js script it gives the following error XMLHttpRequest cannot load file://localhost/Applications/MAMP/htdocs/Digital/phonegap/www/swipe.js?_=1352274440669. 我在ipad上使用swipejs作为传送带,所以它可以正常工作,直到我不包括jquery.js,但是当我包括jquery.js脚本时,它给出以下错误XMLHttpRequest无法加载file:// localhost / Applications / MAMP / htdocs /Digital/phonegap/www/swipe.js?_=1352274440669。 Origin null is not allowed by Access-Control-Allow-Origin. Access-Control-Allow-Origin不允许使用Origin null。

can any body help me. 有谁能够帮助我。 Thankyou 谢谢

There are 2 sides for enabling cors 有2个侧面可启用cors
1. Client Side Make sure that Cors is enabled.It can be done by meta http-equiv="Access-Control-Allow-Origin" content="*" or use any others option. 1.客户端确保已启用Cors。这可以通过meta http-equiv =“ Access-Control-Allow-Origin” content =“ *”或使用任何其他选项来完成。

  1. Server Side Make sure that Cors is enabled in server side. 服务器端确保在服务器端启用了Cors。 Consider above url fire in rest client or advanced rest client and check cors is enabled if it is enabled then response message should have this Access-Control-Allow-Origin: * in header 考虑以上在REST Client或Advanced Rest Client中的URL触发,并检查是否启用了cors,如果响应消息已启用,则响应消息中应具有以下Access-Control-Allow-Origin:*

Solution to your Problem is that above url may not be cors enabled and pls check by firing url with using advanced restclient in chrome in client side is enabled as default or not please enabled it . 解决您的问题的方法是,可能未启用上述url,并且默认情况下启用了在客户端使用chrome中的高级restclient通过触发url进行pls检查的默认设置。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM